如何从特定目录中选择日志并显示在 Kibana 上

How can I pick logs from a specific directory and display on Kibana

我是 elastic-stack 的新手。我在本地环境的 Ubuntu 16.04 上设置了一个 elastic-stack 和 filebeat。现在我想从特定目录读取日志文件。在我的例子中,LogFile 是我的目录,它位于 Ubuntu 桌面上。 我想知道如何从该文件读取日志并显示在 Kibana 仪表板上。

感谢您的帮助。

很简单。 非常基本的部署:阅读beats(更简单)或Logstash(当你从文件中读取时,你必须知道watcher)。

首先,您可以使用最简单版本的 Logstash 配置:

input {
  file {
   path => "/var/log/yourlog.log"
   start_position => "beginning"
 }
}

filter {
#your filter etc, by default you will parse everything into messages
}


output {
    elasticsearch {
        hosts =>  ["your_elasticsearch:9200"]
        index => "your_index"
    }
}