I've found that I'm only able to apply ['^{'] this pattern to include_lines when I omit json parsing from the yml. After reading the documentation, it implies the line_filtering is done after parsing, so if that's the case, how do I filter lines that I don't want included?
Examples below
This works
filebeat.inputs:
- type: log
enabled: true
paths:
- /applogs/*.log*
include_lines: ['^{']
# json.message_key: "level"
# json.keys_under_root: true
# json.overwrite_keys: true
processors:
- add_fields:
fields:
kibanaspace: "specific-space"
This does not.
filebeat.inputs:
- type: log
enabled: true
paths:
- /applogs/*.log*
include_lines: ['^{']
json.message_key: "level"
json.keys_under_root: true
json.overwrite_keys: true
processors:
- add_fields:
fields:
kibanaspace: "specific-space"
given an input log file of
{"level": "INFO", "workerId": "5cced6bb522d-10-139641205327616", "traceId": null, "message": "Metrics blah", "datetime": "20-01-09 00:17:10:446539"}
{"level": "INFO", "workerId": "5cced6bb522d-10-139641205327616", "traceId": null, "message": "Metrics blah", "datetime": "20-01-09 00:17:10:446539"}
This is a 3rd party log that I dont want captured
Another unstructured log I want filtered out