I've a logstash conf file like the following:
input {
generator {
type => "generated"
}
}
filter {
metrics {
type => "generated"
meter => "foo"
add_tag => "metric"
add_field => [ "foo", "Hello world, from %{host}" ]
}
}
output {
if [type] != "generated" {
stdout {
debug => true
}
}
}
that produces the following output:
{
"@timestamp" => "2017-07-28T11:00:01.123Z",
"@version" => "1",
"message" => "27b0c651-0dc0-4910-8c6f-98778e76f2b3",
"foo.count" => 1,
"foo.rate_1m" => 0.0,
"foo.rate_5m" => 0.0,
"foo.rate_15m" => 0.0,
"foo" => "Hello world, from %{host}",
"tags" => [
[0] "metric"
]
}
Instead of having the string "%{host}" I would like to have the resolved host name.
Unfortunately this doesn't happen. Not resolving the dynamic field in metrics seems to be an old bug of logstash (isn't it ?).
Unfortunately I don't have any clue about how to resolve it.
Is there anybody that could provide me a solution ? A workaround is also very well accepted.
Thanks a lot in advance