Did replace fluentd/logstash with filebeat. Use filebeat on 6.2 version and works well, filebeat-prospector with following config. Explaining: type docker did not work, because json in json problem, error messages with parsing that. With type log works good, got result in elasticsearch.
data:
kubernetes.yml: |-
# - type: docker
# containers.ids:
# - "*"
# json.message_key: log
# json.keys_under_root: false
# processors:
# - add_kubernetes_metadata:
# in_cluster: true
# _type: ${ENV}
- type: log
paths:
- /var/lib/docker/containers/*/*.log
tags: ['${ENV}']
json.message_key: log
json.keys_under_root: true
processors:
- add_kubernetes_metadata:
in_cluster: true
Problem interpreting LOG property on .. see elasticsearch JSON, log property isn't expanded as expected.. Previous logstash
implementations works in a manner to expand that to accessing req_id
:
{
"_index": "filebeat-6.2.2-2018.02.22",
"_type": "doc",
"_id": "YY1CvmEB2trujBDGJh6G",
"_version": 1,
"_score": null,
"_source": {
"@timestamp": "2018-02-22T16:03:13.830Z",
"source": "/var/lib/docker/containers/f5d45b3a82edc03b4eae73e30a6d2b5c947e040ec3e8fcb1ed3520b36b6df172/f5d45b3a82edc03b4eae73e30a6d2b5c947e040ec3e8fcb1ed3520b36b6df172-json.log",
"log": "{\"name\":\"api\",\"hostname\":\"api-746cc7c4f4-fr94g\",\"pid\":91,\"req_id\":\"deac7d70-8975-4bb3-a4a8-c19d2b7d8859\",\"handler\":\"concurrencyDecreaseMiddleware\",\"level\":20,\"msg\":\"end\",\"time\":\"2018-02-22T16:03:08.894Z\",\"v\":0}",
"prospector": {
"type": "log"
},
"kubernetes": {
"labels": {
"pod-template-hash": "3027737090",
"name": "api"
},
"container": {
"name": "api"
},
"pod": {
"name": "api-746cc7c4f4-fr94g"
},
"node": {
"name": "172.31.25.241"
},
"namespace": "dev"
},
"beat": {
"name": "filebeat-2lfqb",
"hostname": "filebeat-2lfqb",
"version": "6.2.2"
},
"stream": "stdout",
"time": "2018-02-22T16:03:08.895228712Z",
"offset": 335910,
"tags": [
"aws"
],
"meta": {
"cloud": {
"provider": "ec2",
"region": "eu-central-1",
"availability_zone": "eu-central-1b",
"instance_id": "....",
"machine_type": "m4.xlarge"
}
}
},
"fields": {
"@timestamp": [
"2018-02-22T16:03:13.830Z"
]
},
"highlight": {
"kubernetes.container.name": [
"@kibana-highlighted-field@api@/kibana-highlighted-field@"
],
"kubernetes.namespace": [
"@kibana-highlighted-field@dev@/kibana-highlighted-field@"
]
},
"sort": [
1519315393830
]
}
What did the trick?