我有一个Python程序正在编写以下示例JSON日志行:
{"levelname": "DEBUG", "asctime": "2020-02-04 08:37:42,128", "module": "scale_out", "thread": 139793342834496, "filename": "scale_out.py", "lineno": 130, "funcName": "_check_if_can_remove_inactive_components", "message": "inactive_components: set([]), num_of_components_active: 0, max num_of_components_to_keep: 1"}
在filebeat.yml中,我试图排除所有DEBUG日志被发送到Elasticsearch。我尝试使用exclude_lines
关键字,但Filebeat仍会发布这些事件。
我还尝试过将processor
与drop event
结合使用
filebeat.inputs:
- type: log
enabled: true
paths:
- /var/log/my_service/*.log
json.keys_under_root: true
json.add_error_key: true
json.message_key: "module"
exclude_lines: ['DEBUG'] # also tried ['.*DEBUG.*']
keep_null: true
processors:
- drop_event:
when:
levelname: 'DEBUG'
任何想法我可能做错了什么?
嗯..我期望它更容易(而且更愚蠢)。尽管exclude_lines不起作用(仍然),我能够使drop_event正常工作。