Is there any way I can get the IP address of the logstash node within metric plugin? my code is like this --
filter {
metrics {
meter => "events"
add_tag => "metric"
}
}
output {
if "metric" in [tags] {
elasticsearch {
host => "10.207.96.20"
index => "metrics"
document_id => "mydoc__id"
}
}
}
And the output I get from Elasticsearch is like this --
{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 1,
"hits": [
{
"_index": "metrics",
"_type": "logs",
"_id": "mydoc__id",
"_score": 1,
"_source": {
"@version": "1",
"@timestamp": "2015-10-05T06:39:16.204Z",
"message": "LogConcentrator.juniper.net",
"events.count": 16614,
"events.rate_1m": 119.04031830447626,
"events.rate_5m": 28.09862951056484,
"events.rate_15m": 12.343469930579069,
"tags": [
"metric"
]
}
}
]
}
}
Here the message field returns the Hostname but I need the corresponding IP address. Is there a way to get it?