I am trying to push logs in json format to logstash through filebeat. My logs are decoded/parsed correctly except for only one field with name "message". When I rename the field, it is being parsed correctly. There is issue only when the field name is "message"
Below is my log format:
`{"type":"cloud_monitor","format":"default","version":"1.0","id":"ceda60685a1fba7512e9eb4","start":"1512028789.984","cp":"532198","message":{"proto":"https","protoVer":"1.1","status":"200","cliIP":"********","reqPort":"443","reqHost":"*******","reqMethod":"POST","reqPath":"%2fsolr%2fcontent_Publish%2fupdate","reqQuery":"wt%3djavabin%26version%3d2","reqCT":"application%2fxml%3b%20charset%3dUTF-8","sslVer":"TLSv1.2","respCT":"application/octet-stream","respLen":"44","bytes":"44","UA":"Solr%5borg.apache.solr.client.solrj.impl.HttpSolrServer%5d%201.0","fwdHost":"********"},"reqHdr":{"conn":"Keep-Alive",},"netPerf":{"downloadTime":"31","lastMileRTT":"4","midMileRTT":"8","midMileLatency":"6","netOriginLatency":"17","cacheStatus":"0","firstByte":"1","lastByte":"1","asnum":"14618","edgeIP":"*******"},"geo":{"country":"US","region":"VA","city":"ASHBURN","lat":"39.0438","long":"-77.4879"}}`
The logs in logstash looks like:
My filebeat config is as follows:
- type: log
# Change to true to enable this prospector configuration.
enabled: true
# Paths that should be crawled and fetched. Glob based paths.
paths:
- /data2/testlogs/*.log
tags: ["json"]
json.keys_under_root: true
json.add_error_key: true
And my Logstash config is as follows:
input {
beats {
port => 5044
codec => "json"
}
}
filter {
json {
source => "source_input"
}
mutate {
remove_field => [ "remote_user" , "[reqHdr][cookie]" ]
}
}
output {
elasticsearch {
hosts => "localhost:9200"
}
}
Kindly help me as to why I am having issues in parsing json file only for one field "message". If I rename the field in the source file, the parsing is done correctly without issues. I also tried renaming in the logstash field, that was of no help.
Kindly help in identifying the issue