[英]Logstash kafka topic as part of elasticsearch indexname
I want to use kafka topic as part of es-indexname. 我想将kafka主题用作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? 有人可以在此logstash.conf中找到问题吗?
hello this is working config: 你好,这是工作配置:
input {
kafka {
...
decorate_events => true
}
}
filter {
mutate {
add_field => {"[@metadata][index]" => "%{[kafka][topic]}"}
}
}
output {
elasticsearch {
index => "kafka-%{[@metadata][index]}-%{+YYYY.MM.dd}"
...
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.