Hi Guys,
spent a day on this thing.
i got a json log that being sent to filebeat and from there to logstash.
The problem:
i've added docker_metadata in filebeat,
i also see the docker metadata there in logstash ouput but im unable to add a custom field that has a vaule of one of the docker_metadata..
those are the lables in my dockers;
<
"Labels": {
"com.amazonaws.ecs.cluster": "ecsFrontendCluster",
"com.amazonaws.ecs.container-name": "site",
"com.amazonaws.ecs.task-arn": "xxxxxxx-41d4-a410-xx",
"com.amazonaws.ecs.task-definition-family": "site",
"com.amazonaws.ecs.task-definition-version": "150"
}
/>
the log file that being ingested by logstash (ouput) -
<
......
......
"docker": {
"container": {
"labels": {
"com": {
"amazonaws": {
"ecs": {
"task-definition-version": "150",
"task-arn": "xxxxxx",
"cluster": "ecsFrontendCluster",
"container-name": "site",
"task-definition-family": "site"
}
}
}
}
.....
/>
what i wish to do is the following:
i want to have a new field that will be under my metadata:
<
filter {
mutate {
copy => { "[docker][container][Labels][com][amazonaws][ecs][task-definition-family]" => "[@metadata][docker_role]]" }
}
}
/>
then i wish to use the metadata as an index name
whatever i did,
i wasn't able to get access to the docker values.
thanks!