@@ -9,21 +9,25 @@ For Filebeat 7.16+
99.filebeat.yaml
1010----
1111filebeat.inputs:
12- - type: filestream
12+ - type: filestream <1>
1313 paths: /path/to/logs.json
1414 parsers:
1515 - ndjson:
16- keys_under_root: true
17- overwrite_keys: true
18- add_error_key: true
19- expand_keys: true
16+ overwrite_keys: true <2>
17+ add_error_key: true <3>
18+ expand_keys: true <4>
2019
21- processors:
20+ processors: <5>
2221 - add_host_metadata: ~
2322 - add_cloud_metadata: ~
2423 - add_docker_metadata: ~
2524 - add_kubernetes_metadata: ~
2625----
26+ <1> Use the filestream input to read lines from active log files.
27+ <2> Values from the decoded JSON object overwrite the fields that {filebeat} normally adds (type, source, offset, etc.) in case of conflicts.
28+ <3> {filebeat} adds an "error.message" and "error.type: json" key in case of JSON unmarshalling errors.
29+ <4> {filebeat} will recursively de-dot keys in the decoded JSON, and expand them into a hierarchical object structure.
30+ <5> Processors enhance your data. See {filebeat-ref} /filtering-and-enhancing-data.html[processors] to learn more.
2731
2832For Filebeat < 7.16
2933
@@ -57,11 +61,13 @@ processors:
5761[source,yaml]
5862----
5963annotations:
60- co.elastic.logs/json.keys_under_root: true
61- co.elastic.logs/json.overwrite_keys: true
62- co.elastic.logs/json.add_error_key: true
63- co.elastic.logs/json.expand_keys: true
64+ co.elastic.logs/json.overwrite_keys: true <1>
65+ co.elastic.logs/json.add_error_key: true <2>
66+ co.elastic.logs/json.expand_keys: true <3>
6467----
68+ <1> Values from the decoded JSON object overwrite the fields that {filebeat} normally adds (type, source, offset, etc.) in case of conflicts.
69+ <2> {filebeat} adds an "error.message" and "error.type: json" key in case of JSON unmarshalling errors.
70+ <3> {filebeat} will recursively de-dot keys in the decoded JSON, and expand them into a hierarchical object structure.
6571// end::kubernetes[]
6672
6773
@@ -76,10 +82,11 @@ annotations:
7682.docker-compose.yml
7783----
7884labels:
79- co.elastic.logs/json.keys_under_root: true
80- co.elastic.logs/json.overwrite_keys: true
81- co.elastic.logs/json.add_error_key: true
82- co.elastic.logs/json.expand_keys: true
85+ co.elastic.logs/json.overwrite_keys: true <1>
86+ co.elastic.logs/json.add_error_key: true <2>
87+ co.elastic.logs/json.expand_keys: true <3>
8388----
89+ <1> Values from the decoded JSON object overwrite the fields that {filebeat} normally adds (type, source, offset, etc.) in case of conflicts.
90+ <2> {filebeat} adds an "error.message" and "error.type: json" key in case of JSON unmarshalling errors.
91+ <3> {filebeat} will recursively de-dot keys in the decoded JSON, and expand them into a hierarchical object structure.
8492// end::docker[]
85-
0 commit comments