浏览代码

[filebeat] Add json parsing to filebeat

Colin Powell 3 年之前
父节点
当前提交
589b52541f
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      ansible/roles/filebeat/files/filebeat.yml

+ 8 - 0
ansible/roles/filebeat/files/filebeat.yml

@@ -4,6 +4,14 @@ filebeat.inputs:
     paths:
     paths:
       - "/var/log/*.log"
       - "/var/log/*.log"
     exclude_lines: [".*mdnsd.*", ".*syslogd.*"]
     exclude_lines: [".*mdnsd.*", ".*syslogd.*"]
+  - type: filestream
+    enabled: true
+    paths:
+      - "/var/log/*.json"
+    fields_under_root: true
+    json.message_key: message
+    fields:
+      tags: ["json"]
 
 
 filebeat.config.modules:
 filebeat.config.modules:
   path: ${path.config}/filebeat.modules.d/*.yml
   path: ${path.config}/filebeat.modules.d/*.yml