Hi all,
I am using Filebeat 5.0 rc and shipping logs directly to ES/Kibana.
I am currently trying to use the JSON option to decode my JSON object log message. The behavior I'm seeing is that when I include the JSON config and send a request to my server that usually generates 40 log messages, Filebeat is able to parse the message and export the JSON object fields to root level, but it also reports a parsing issue and doesn't ship the rest of the logs afterwards. If I hit it again, it only again only parse the first message.
If I remove the JSON configs and send a request, all 40 log messages will appear on Kibana (instead of just 1).
Here's is my JSON config:
json.message_key: message
json.keys_under_root: true
json.add_error_key: true
And here are two examples of a particular log record with JSON off, and then JSON on:
OFF
{
"_index": "fb-ehrmantraut",
"_type": "log",
"_id": "AVfEfwwm-d2cWVXzsgPe",
"_score": null,
"_source": {
"@timestamp": "2016-10-14T18:40:38.049Z",
"beat": {
"hostname": "ip-10-199-145-7",
"name": "ip-10-199-145-7"
},
"input_type": "log",
"message": "{"AdSessionID":"testadsessionid-tp-redefine-protobuf","level":"info","msg":"received playback event of type: MIDPOINT","time":"2016-10-14T18:40:34Z"}",
"offset": 421320,
"source": "/var/log/ehrmantraut.log",
"type": "log"
},
"fields": {
"@timestamp": [
1476470438049
]
},
"sort": [
1476470438049
]
}
ON
{
"_index": "fb-ehrmantraut",
"_type": "log",
"_id": "AVfEg9WE-d2cWVXzsgP4",
"_score": null,
"_source": {
"@timestamp": "2016-10-14T18:45:46.683Z",
"AdSessionID": "testadsessionid-tp-redefine-protobuf",
"beat": {
"hostname": "ip-10-199-145-7",
"name": "ip-10-199-145-7"
},
"input_type": "log",
"json_error": "Key 'message' not found",
"level": "info",
"message": "",
"msg": "received playback event of type: MIDPOINT",
"offset": 435703,
"source": "/var/log/ehrmantraut.log",
"time": "2016-10-14T18:45:39Z",
"type": "log"
},
"fields": {
"@timestamp": [
1476470746683
],
"time": [
1476470739000
]
},
"sort": [
1476470746683
]
}
I'm also confused why a JSON_ERROR of key 'message' not found is being reported when it is in fact able to export all those fields to root. And then when this parse error occurs, the rest of my logs are not being shipped. Any ideas?