不能在kibana中获取索引相关数据

我能够使用logstash.conf创build索引。 我的inputtypes是gelf。 我正在发送logstash日志到kibana。 这是我的logstash.conf

input { gelf { } } output { stdout { codec => rubydebug } elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-math-%{+YYYY.MM.dd}" } elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-science-%{+YYYY.MM.dd}" } elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-bio-%{+YYYY.MM.dd}" } elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-lang-%{+YYYY.MM.dd}" } } 

问题:现在将日志发送到所有的索引。 我想发送日志到各自的指数。

我已经添加了

 if[tag] == "templeton-math"{ elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-math-%{+YYYY.MM.dd}" } } 

它提供了一个错误信息logstash.agent – 找不到持久的UUID文件。 生成新的UUID {:uuid =>“67f7a48e-fc7c-499b-85a0-3fd6979f88f6”,:path =>“/ var / lib / logstash / uuid”} 14:58:14.308 [LogStash :: Runner] ERROR logstash.agent – 无法在输出\ n \ n {\ n \ n elasticsearch {\ n hosts“}之后在第22行第9列(第179字节)创buildpipe道{:reason =>”期望的#,=> 2017-10-11 14:58:14,355 Api Webserver错误找不到log4j2configuration文件。 使用默认configuration:仅将错误logging到控制台。

尝试这个。

 output { stdout { codec => rubydebug } if [tag] == "templeton-math" { elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-math-%{+YYYY.MM.dd}" } } if [tag] == "templeton-science" { elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-science-%{+YYYY.MM.dd}" } } if [tag] == "templeton-bio" { elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-bio-%{+YYYY.MM.dd}" } } if [tag] == "templeton-lang" { elasticsearch { hosts => ["elk.lera.com:80"] index => "templeton-lang-%{+YYYY.MM.dd}" } } }