【发布时间】:2017-05-11 11:39:20
【问题描述】:
我有几个安装了 filebeat 的 Web 服务器,我希望每个主机有多个索引。
我当前的配置看起来像
input {
beats {
ports => 1337
}
}
filter {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}"}
}
geoip {
source => "clientip"
}
}
output {
elasticsearch {
if [beat][hostname] == "luna"
{
hosts => "10.0.1.1:9200"
manage_template => true
index => "lunaindex-%{+YYYY.MM.dd}"
document_type => "apache"
}
}
}
但是上面的配置结果是
给定的配置无效。原因:预期为 #, => 之一 第 22 行,第 6 列(字节 346)
这是 if 语句发生的地方。有什么帮助吗?
我希望将上述内容以嵌套格式作为
if [beat][hostname] == "lina"
{
index = lina
}
else if [beat][hostname] == "lona"
{
index = lona
}
等等。有什么帮助吗?
【问题讨论】:
标签: elasticsearch logstash logstash-grok logstash-configuration