【问题标题】:Not able ot fetch the indices related data in kibana无法在 kibana 中获取与索引相关的数据
【发布时间】:2017-10-11 15:31:06
【问题描述】:

我可以使用 logstash.conf 创建索引。我的输入类型是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}"
 }
}

它给出了一个错误 INFO logstash.agent - 没有找到持久的 UUID 文件。生成新的 UUID {:uuid=>"67f7a48e-fc7c-499b-85a0-3fd6979f88f6", :path=>"/var/lib/logstash/uuid"} 14:58:14.308 [LogStash::Runner] 错误 logstash.agent - 无法创建管道 {:reason=>" 输出后的第 22 行第 9 列(字节 179)中的预期 #, => 之一 \n\n{\ n\n 弹性搜索 {\n 主机 "} 2017-10-11 14:58:14,355 Api Webserver 错误未找到 log4j2 配置文件。使用默认配置:仅将错误记录到控制台。

【问题讨论】:

  • 请在添加所有相应的 ES 主机条件后粘贴您的最终 logstash 配置文件。

标签: docker elasticsearch logstash kibana gelf


【解决方案1】:

试试这个。

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}"
        }
    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-07
    • 1970-01-01
    • 2014-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多