filebeat.yml configuration
<
paths:
#- /var/log/*.log
- /ap/logs/error_log
include_lines: ['^{']
json.keys_under_root: true
json.add_error_key: true
json.overwrite_keys: true
tail_files: true
/>
filebeat logs:
018-03-30T19:19:13.578+0530 ERROR reader/json.go:32 Error decoding JSON: invalid character 'G' looking for beginning of value
2018-03-30T19:19:13.578+0530 ERROR reader/json.go:32 Error decoding JSON: invalid character 'A' looking for beginning of value
2018-03-30T19:19:13.578+0530 ERROR reader/json.go:32 Error decoding JSON: invalid character 'S' looking for beginning of value
2018-03-30T19:19:13.578+0530 ERROR reader/json.go:32 Error decoding JSON: EOF
2018-03-30T19:19:13.578+0530 ERROR reader/json.go:32 Error decoding JSON: invalid character 'P' looking for beginning of value
2018-03-30T19:19:13.579+0530 ERROR reader/json.go:32 Error decoding JSON: EOF
2018-03-30T19:19:13.579+0530 ERROR reader/json.go:32 Error decoding JSON: invalid character 'O' looking for beginning of value
in error_log file:
- json logs are single line.
- non json log can be single or multiline
Problem:
if include is applied to filebeat.yml then error logs are also shipped to elasticsearch with json logs. I want to tranfer only json logs from error_log file.
I need a quick help..
Thanks,