【发布时间】:2016-12-30 10:41:31
【问题描述】:
我在 Ubuntu 中使用 logstash 1.5.6。
我在/etc/logstash/conf.d 中写了两个配置文件,指定不同的输入/输出位置:
文件 A:
input {
file {
type => "api"
path => "/mnt/logs/api_log_access.log"
}
}
filter {
...
}
output {
if "_grokparsefailure" not in [tags] {
elasticsearch {
host => "localhost"
protocol => "http"
index => "api-%{+YYYY.MM.dd}"
template => "/opt/logstash/template/api_template.json"
template_overwrite => true
}
}
}
文件 B:
input {
file {
type => "mis"
path => "/mnt/logs/mis_log_access.log"
}
}
filter {
...
}
output {
if "_grokparsefailure" not in [tags] {
elasticsearch {
host => "localhost"
protocol => "http"
index => "mis-%{+YYYY.MM.dd}"
template => "/opt/logstash/template/mis_template.json"
template_overwrite => true
}
}
}
但是,我可以看到来自/mnt/logs/mis_log_access.log 和/mnt/logs/nginx/dmt_access.log 的数据都显示在索引api-%{+YYYY.MM.dd} 和mis-%{+YYYY.MM.dd} 中,这不是我想要的。
配置有什么问题?谢谢。
【问题讨论】:
标签: nginx elasticsearch logstash elastic-stack