We would like to create a custom index in ES using hostname, date, and a variable from a file if possible. Here is our current output
output {
elasticsearch {
hosts => "127.0.0.1"
index => "logstash-%{+YYYY.MM.dd}"
}
}
That works fine for creating logstash-date index. However we would like to create an index name logstash-(localhostname)-(variable)-(date). where localhostname is the local system name and variable is some string retrieved from another file or from within the logstash output configuration file.
So our ideal index would be: logstash-(localhost)-(string)-(todaysdate)
Can anyone please help. We cant seem to get this done.
Thanks