I want to use kafka topic as part of es-indexname. Here is my example, but this does not work:
input {
kafka {
...
decorate_events => true
}
}
filter {
mutate {
add_field => {"[@metadata][index]" => "[kafka][topic]"}
}
}
output {
elasticsearch {
index => "kafka-%{[@metadata][index]}-%{+YYYY.MM.dd}"
...
}
}
Can someone find the problem in this logstash.conf?