Hi
I've set up fluentd logging from docker to a fluentd aggregator, which then sends the log to elasticsearch. Looking at the resulting logs in Kibana, I can see the docker log entry, but I can't see the originating host of the container, which makes it difficult to troubleshoot in a hurry on a large cluster.
How would I configure fluentd to add the docker host address and name to the docker logs sent to fluentd-server?
My current log output looks like this:
{
"_index": "fluentd-20180607",
"_type": "access_log",
"_id": "SDKSLDFFNFSF",
"_version": 1,
"_score": null,
"_source": {
"source": "stdout",
"log": "2018-06-07 10:09:35,693 marathon_lb: adding virtual host for app with id /prometheus/nodex",
"container_id": "dc6b9dff667d77250f9597eda750a06d771f5e34139774a23efb884835db0923",
"container_name": "/mesos-86625275-9f89-4f6a-9561-064c746687ce-S4.f50690d0-7b7b-427b-b40f-f9b8d26f990a",
"@timestamp": "2018-06-07T10:09:35.000000000+00:00",
"@log_name": "docker.dc6b9dff667d"
},
"fields": {
"@timestamp": [
1528366175000
]
},
"sort": [
1528366175000
]
}
My fluentd source configuration block looks like this:
<source>
@type forward
tag docker.**
port {{ fluentd_collector_docker_log_port }}
bind {{ fluentd_collector_bind_address }}
@label @mainstream
</source>
Thanks in advance for any help!
Traiano