Skip to content

Commit 7958277

Browse files
authored
docs: update filebeat instructions (#72)
1 parent 438fc2c commit 7958277

File tree

3 files changed

+22
-182
lines changed

3 files changed

+22
-182
lines changed

docs/setup.asciidoc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
// === Step 3: Configure Filebeat
2626
2727
// tag::configure-filebeat[]
28-
include::./tab-widgets/code.asciidoc[]
2928
include::./tab-widgets/filebeat-widget.asciidoc[]
3029
3130
For more information, see the {filebeat-ref}/configuring-howto-filebeat.html[Filebeat reference].

docs/tab-widgets/code.asciidoc

Lines changed: 0 additions & 166 deletions
This file was deleted.

docs/tab-widgets/filebeat.asciidoc

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@ For Filebeat 7.16+
99
.filebeat.yaml
1010
----
1111
filebeat.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

2832
For Filebeat < 7.16
2933

@@ -57,11 +61,13 @@ processors:
5761
[source,yaml]
5862
----
5963
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>
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
----
7884
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>
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

Comments
 (0)