【发布时间】:2018-03-14 08:40:53
【问题描述】:
我对 Logstash 很陌生。
在我们的应用程序中,我们正在创建多个索引,从下面的线程我可以理解如何解决这个问题 How to create multiple indexes in logstash.conf file?
但这会导致 conf 文件中出现许多重复的行(对于主机、ssl 等)。所以我想检查是否有更好的方法?
output {
stdout {codec => rubydebug}
if [type] == "trial" {
elasticsearch {
hosts => "localhost:9200"
index => "trial_indexer"
}
} else {
elasticsearch {
hosts => "localhost:9200"
index => "movie_indexer"
}
}
除了上面的配置,我可以有类似下面的东西吗?
output {
stdout {codec => rubydebug}
elasticsearch {
hosts => "localhost:9200"
}
if [type] == "trial" {
elasticsearch {
index => "trial_indexer"
}
} else {
elasticsearch {
index => "movie_indexer"
}
}
【问题讨论】: