Skip to content

Commit a159cce

Browse files
authored
Add parsers examples to filestream reference configuration (#30529)
1 parent bc1c653 commit a159cce

File tree

3 files changed

+285
-0
lines changed

3 files changed

+285
-0
lines changed

filebeat/_meta/config/filebeat.inputs.reference.yml.tmpl

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,101 @@ filebeat.inputs:
293293
# original for harvesting but will report the symlink name as source.
294294
#prospector.scanner.symlinks: false
295295

296+
### Parsers configuration
297+
298+
#### JSON configuration
299+
300+
#parsers:
301+
#- ndjson:
302+
# Decode JSON options. Enable this if your logs are structured in JSON.
303+
# JSON key on which to apply the line filtering and multiline settings. This key
304+
# must be top level and its value must be a string, otherwise it is ignored. If
305+
# no text key is defined, the line filtering and multiline features cannot be used.
306+
#message_key:
307+
308+
# By default, the decoded JSON is placed under a "json" key in the output document.
309+
# If you enable this setting, the keys are copied to the top level of the output document.
310+
#keys_under_root: false
311+
312+
# If keys_under_root and this setting are enabled, then the values from the decoded
313+
# JSON object overwrite the fields that Filebeat normally adds (type, source, offset, etc.)
314+
# in case of conflicts.
315+
#overwrite_keys: false
316+
317+
# If this setting is enabled, then keys in the decoded JSON object will be recursively
318+
# de-dotted, and expanded into a hierarchical object structure.
319+
# For example, `{"a.b.c": 123}` would be expanded into `{"a":{"b":{"c":123}}}`.
320+
#expand_keys: false
321+
322+
# If this setting is enabled, Filebeat adds an "error.message" and "error.key: json" key in case of JSON
323+
# unmarshaling errors or when a text key is defined in the configuration but cannot
324+
# be used.
325+
#add_error_key: false
326+
327+
#### Multiline options
328+
329+
# Multiline can be used for log messages spanning multiple lines. This is common
330+
# for Java Stack Traces or C-Line Continuation
331+
332+
#parsers:
333+
#- multiline:
334+
#type: pattern
335+
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
336+
#pattern: ^\[
337+
338+
# Defines if the pattern set under the pattern setting should be negated or not. Default is false.
339+
#negate: false
340+
341+
# Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
342+
# that was (not) matched before or after or as long as a pattern is not matched based on negate.
343+
# Note: After is the equivalent to previous and before is the equivalent to next in Logstash
344+
#match: after
345+
346+
# The maximum number of lines that are combined to one event.
347+
# In case there are more than max_lines the additional lines are discarded.
348+
# Default is 500
349+
#max_lines: 500
350+
351+
# After the defined timeout, a multiline event is sent even if no new pattern was found to start a new event
352+
# Default is 5s.
353+
#timeout: 5s
354+
355+
# Do not add new line character when concatenating lines.
356+
#skip_newline: false
357+
358+
# To aggregate constant number of lines into a single event use the count mode of multiline.
359+
360+
#parsers:
361+
#- multiline:
362+
#type: count
363+
364+
# The number of lines to aggregate into a single event.
365+
#count_lines: 3
366+
367+
# The maximum number of lines that are combined to one event.
368+
# In case there are more than max_lines the additional lines are discarded.
369+
# Default is 500
370+
#max_lines: 500
371+
372+
# After the defined timeout, an multiline event is sent even if no new pattern was found to start a new event
373+
# Default is 5s.
374+
#timeout: 5s
375+
376+
# Do not add new line character when concatenating lines.
377+
#skip_newline: false
378+
379+
#### Parsing container events
380+
381+
# You can parse container events with different formats from all streams.
382+
383+
#parsers:
384+
#- container:
385+
# Source of container events. Available options: all, stdin, stderr.
386+
#stream: all
387+
388+
# Format of the container events. Available options: auto, cri, docker, json-file
389+
#format: auto
390+
296391
### Log rotation
297392

298393
# When an external tool rotates the input files with copytruncate strategy

filebeat/filebeat.reference.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,101 @@ filebeat.inputs:
700700
# original for harvesting but will report the symlink name as source.
701701
#prospector.scanner.symlinks: false
702702

703+
### Parsers configuration
704+
705+
#### JSON configuration
706+
707+
#parsers:
708+
#- ndjson:
709+
# Decode JSON options. Enable this if your logs are structured in JSON.
710+
# JSON key on which to apply the line filtering and multiline settings. This key
711+
# must be top level and its value must be a string, otherwise it is ignored. If
712+
# no text key is defined, the line filtering and multiline features cannot be used.
713+
#message_key:
714+
715+
# By default, the decoded JSON is placed under a "json" key in the output document.
716+
# If you enable this setting, the keys are copied to the top level of the output document.
717+
#keys_under_root: false
718+
719+
# If keys_under_root and this setting are enabled, then the values from the decoded
720+
# JSON object overwrite the fields that Filebeat normally adds (type, source, offset, etc.)
721+
# in case of conflicts.
722+
#overwrite_keys: false
723+
724+
# If this setting is enabled, then keys in the decoded JSON object will be recursively
725+
# de-dotted, and expanded into a hierarchical object structure.
726+
# For example, `{"a.b.c": 123}` would be expanded into `{"a":{"b":{"c":123}}}`.
727+
#expand_keys: false
728+
729+
# If this setting is enabled, Filebeat adds an "error.message" and "error.key: json" key in case of JSON
730+
# unmarshaling errors or when a text key is defined in the configuration but cannot
731+
# be used.
732+
#add_error_key: false
733+
734+
#### Multiline options
735+
736+
# Multiline can be used for log messages spanning multiple lines. This is common
737+
# for Java Stack Traces or C-Line Continuation
738+
739+
#parsers:
740+
#- multiline:
741+
#type: pattern
742+
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
743+
#pattern: ^\[
744+
745+
# Defines if the pattern set under the pattern setting should be negated or not. Default is false.
746+
#negate: false
747+
748+
# Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
749+
# that was (not) matched before or after or as long as a pattern is not matched based on negate.
750+
# Note: After is the equivalent to previous and before is the equivalent to next in Logstash
751+
#match: after
752+
753+
# The maximum number of lines that are combined to one event.
754+
# In case there are more than max_lines the additional lines are discarded.
755+
# Default is 500
756+
#max_lines: 500
757+
758+
# After the defined timeout, a multiline event is sent even if no new pattern was found to start a new event
759+
# Default is 5s.
760+
#timeout: 5s
761+
762+
# Do not add new line character when concatenating lines.
763+
#skip_newline: false
764+
765+
# To aggregate constant number of lines into a single event use the count mode of multiline.
766+
767+
#parsers:
768+
#- multiline:
769+
#type: count
770+
771+
# The number of lines to aggregate into a single event.
772+
#count_lines: 3
773+
774+
# The maximum number of lines that are combined to one event.
775+
# In case there are more than max_lines the additional lines are discarded.
776+
# Default is 500
777+
#max_lines: 500
778+
779+
# After the defined timeout, an multiline event is sent even if no new pattern was found to start a new event
780+
# Default is 5s.
781+
#timeout: 5s
782+
783+
# Do not add new line character when concatenating lines.
784+
#skip_newline: false
785+
786+
#### Parsing container events
787+
788+
# You can parse container events with different formats from all streams.
789+
790+
#parsers:
791+
#- container:
792+
# Source of container events. Available options: all, stdin, stderr.
793+
#stream: all
794+
795+
# Format of the container events. Available options: auto, cri, docker, json-file
796+
#format: auto
797+
703798
### Log rotation
704799

705800
# When an external tool rotates the input files with copytruncate strategy

x-pack/filebeat/filebeat.reference.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,101 @@ filebeat.inputs:
27592759
# original for harvesting but will report the symlink name as source.
27602760
#prospector.scanner.symlinks: false
27612761

2762+
### Parsers configuration
2763+
2764+
#### JSON configuration
2765+
2766+
#parsers:
2767+
#- ndjson:
2768+
# Decode JSON options. Enable this if your logs are structured in JSON.
2769+
# JSON key on which to apply the line filtering and multiline settings. This key
2770+
# must be top level and its value must be a string, otherwise it is ignored. If
2771+
# no text key is defined, the line filtering and multiline features cannot be used.
2772+
#message_key:
2773+
2774+
# By default, the decoded JSON is placed under a "json" key in the output document.
2775+
# If you enable this setting, the keys are copied to the top level of the output document.
2776+
#keys_under_root: false
2777+
2778+
# If keys_under_root and this setting are enabled, then the values from the decoded
2779+
# JSON object overwrite the fields that Filebeat normally adds (type, source, offset, etc.)
2780+
# in case of conflicts.
2781+
#overwrite_keys: false
2782+
2783+
# If this setting is enabled, then keys in the decoded JSON object will be recursively
2784+
# de-dotted, and expanded into a hierarchical object structure.
2785+
# For example, `{"a.b.c": 123}` would be expanded into `{"a":{"b":{"c":123}}}`.
2786+
#expand_keys: false
2787+
2788+
# If this setting is enabled, Filebeat adds an "error.message" and "error.key: json" key in case of JSON
2789+
# unmarshaling errors or when a text key is defined in the configuration but cannot
2790+
# be used.
2791+
#add_error_key: false
2792+
2793+
#### Multiline options
2794+
2795+
# Multiline can be used for log messages spanning multiple lines. This is common
2796+
# for Java Stack Traces or C-Line Continuation
2797+
2798+
#parsers:
2799+
#- multiline:
2800+
#type: pattern
2801+
# The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
2802+
#pattern: ^\[
2803+
2804+
# Defines if the pattern set under the pattern setting should be negated or not. Default is false.
2805+
#negate: false
2806+
2807+
# Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
2808+
# that was (not) matched before or after or as long as a pattern is not matched based on negate.
2809+
# Note: After is the equivalent to previous and before is the equivalent to next in Logstash
2810+
#match: after
2811+
2812+
# The maximum number of lines that are combined to one event.
2813+
# In case there are more than max_lines the additional lines are discarded.
2814+
# Default is 500
2815+
#max_lines: 500
2816+
2817+
# After the defined timeout, a multiline event is sent even if no new pattern was found to start a new event
2818+
# Default is 5s.
2819+
#timeout: 5s
2820+
2821+
# Do not add new line character when concatenating lines.
2822+
#skip_newline: false
2823+
2824+
# To aggregate constant number of lines into a single event use the count mode of multiline.
2825+
2826+
#parsers:
2827+
#- multiline:
2828+
#type: count
2829+
2830+
# The number of lines to aggregate into a single event.
2831+
#count_lines: 3
2832+
2833+
# The maximum number of lines that are combined to one event.
2834+
# In case there are more than max_lines the additional lines are discarded.
2835+
# Default is 500
2836+
#max_lines: 500
2837+
2838+
# After the defined timeout, an multiline event is sent even if no new pattern was found to start a new event
2839+
# Default is 5s.
2840+
#timeout: 5s
2841+
2842+
# Do not add new line character when concatenating lines.
2843+
#skip_newline: false
2844+
2845+
#### Parsing container events
2846+
2847+
# You can parse container events with different formats from all streams.
2848+
2849+
#parsers:
2850+
#- container:
2851+
# Source of container events. Available options: all, stdin, stderr.
2852+
#stream: all
2853+
2854+
# Format of the container events. Available options: auto, cri, docker, json-file
2855+
#format: auto
2856+
27622857
### Log rotation
27632858

27642859
# When an external tool rotates the input files with copytruncate strategy

0 commit comments

Comments
 (0)