I have the following setting: Filebeat => Logstash
My problem is, that Filebeat is not recognizing \n as a line ending and is then packing multiple lines into one message.
Log Input (with Unix line endings \n):
2018-11-07 17:24:26 178.1.111.11 app/nativeDataCommon/ []
2018-11-07 17:24:26 178.1.111.11 app/nativeDataCommon/ []
2018-11-07 17:24:28 178.1.111.11 app/nativeDataCommon/ []
When I have a look at the output from logstash, the message arrives like this:
"message":"2018-11-07 17:24:26\t178.1.111.11\tapp/nativeDataCommon/\t[]\t\t\n2018-11-07 17:24:26\t178.1.111.11\tapp/nativeDataCommon/\t[]\t\t\n2018-11-07 17:24:28\t178.1.111.11\tapp/nativeDataCommon/\t[]\t\t\n"
Anyone an idea what I am doing wrong?
A bit strange is, that in the stdout there is also the flag 'multiline' set. Even it is not in the config.
"log":{"flags":["multiline"]}
filebeat.yml:
filebeat.inputs:
- type: log
enabled: false
paths:
- /var/log/*.log
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.template.settings:
index.number_of_shards: 3
setup.kibana:
host: "192.168.131.170:5601"
output.logstash:
hosts: ["localhost:5044"]
processors:
- add_host_metadata: ~
- add_cloud_metadata: ~
filebeat/modules.d/logstash.yml
- module: logstash
log:
enabled: true
var.paths: ["/logtemptest8/*"]
slowlog:
enabled: false
logstash/conf.d/logstash.conf
input {
beats {
port => 5044
}
}
filter {
grok {
match => {"message" => "%{NOTSPACE:date} %{NOTSPACE:time}[\t]%{IP:client}[\t]%{NOTSPACE:request}[\t]%{NOTSPACE:other}"}
}
mutate {
add_field => {
"timestamp" => "%{date} %{time}"
}
remove_field => ["date", "time"]
}
date {
match => ["timestamp", "yyyy-MM-dd HH:mm:ss"]
timezone => "Europe/Zurich"
}
}
output {
stdout {
codec => json
}
}