ELK: 7.71
On the debugger grok looks good, but when I send filebeat->logstash->elasticsearch, on kibana none of the fields I mapped is there. Any on has an idea?
I have the following log structure:
2020-06-18T23:10:43.377Z [pid:#PID<0.474.0>, application: :logster, request_id: "Fhm_oW8UBaB9RngAAABM"] [info] {"action":"get","controller":"Web.PlayersController","duration":51.271,"format":"json","method":"POST","params":{"player_id":"b5c0c249-1e78-4e14-b3a2-ad283a358ec1"},"path":"/api/players","state":"set","status":200}
My filebeat has:
- type: log
enabled: true
- /tmp/logs/info.log
My logstash.conf filter is:
filter {
if [fileset][name] == "log" {
grok {
match => { "message" => ["%{TIMESTAMP_ISO8601:timestamp} \[pid:#PID<%{NOTSPACE:pid}>, application: :%{GREEDYDATA:application}, request_id: \"%{GREEDYDATA:request_id}\"\] \[%{LOGLEVEL:level}\] {%{DATA:json_data}}"] }
remove_field => "message"
}
date {
match => [ "timestamp", "TIMESTAMP_ISO8601"]
}
json {
source => "json_data"
target => "log"
}
}
}
Filebeat processor:
2020-06-27T23:25:41.542+0200 DEBUG [processors] processing/processors.go:187 Publish event: {
"@timestamp": "2020-06-27T21:25:41.541Z",
"@metadata": {
"beat": "filebeat",
"type": "_doc",
"version": "7.7.1"
},
"agent": {
"version": "7.7.1",
"type": "filebeat",
"ephemeral_id": "68977da9-51f1-4805-b1b8-77a79154b964",
"hostname": "**********",
"id": "fa178769-e8ed-49b9-857b-1f9952306585"
},
"ecs": {
"version": "1.5.0"
},
"host": {
"architecture": "x86_64",
"os": {
"name": "*******",
"kernel": "********",
"build": "*******",
"platform": "darwin",
"version": "******",
"family": "darwin"
},
"id": "1ACB892B-00D1-5EB0-BA1D-E4C63D269CD8",
"ip": [
*******
],
"name": "*******",
"mac": [
******
],
"hostname": "*******"
},
"log": {
"file": {
"path": "/tmp/logs/info.log"
},
"offset": 536
},
"message": "2020-06-26T17:44:11.731Z [pid: #PID<0.474.0>, application: :logster, request_id: \"FhwidG1_g6h9RngAAAAB\"] [info] {\"action\":\"get\",\"controller\":\"Web.PlayersController\",\"duration\":101.043,\"format\":\"json\",\"method\":\"POST\",\"params\":{\"player_id\":\"664981e8-293c-42e7-9b7c-5312827600af\"},\"path\":\"/api/players\",\"state\":\"set\",\"status\":200}",
"input": {
"type": "log"
}
}