@@ -9,21 +9,25 @@ For Filebeat 7.16+
9
9
.filebeat.yaml
10
10
----
11
11
filebeat.inputs:
12
- - type: filestream
12
+ - type: filestream <1>
13
13
paths: /path/to/logs.json
14
14
parsers:
15
15
- 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>
20
19
21
- processors:
20
+ processors: <5>
22
21
- add_host_metadata: ~
23
22
- add_cloud_metadata: ~
24
23
- add_docker_metadata: ~
25
24
- add_kubernetes_metadata: ~
26
25
----
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.
27
31
28
32
For Filebeat < 7.16
29
33
@@ -57,11 +61,13 @@ processors:
57
61
[source,yaml]
58
62
----
59
63
annotations:
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>
64
67
----
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.
65
71
// end::kubernetes[]
66
72
67
73
@@ -76,10 +82,11 @@ annotations:
76
82
.docker-compose.yml
77
83
----
78
84
labels:
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>
83
88
----
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.
84
92
// end::docker[]
85
-
0 commit comments