首页 文章

无法在elasticsearch中查看Apache日志

提问于
浏览
0

我在Windows上安装了ELK堆栈并配置了Logstash以读取Apache日志文件 . 我似乎无法在Elasticsearch中看到输出 . 我是ELK堆栈的新手 .

Environment Setup
Elasticsearch:http://localhost:9200/
Logstash:
Kibana:http://localhost:5601/

上述所有3个应用程序都作为服务运行 .

我创建了一个名为“ logstash.conf ”的文件来读取 "C:\Elk\logstash\conf\logstash.conf" 中的apache日志,其中包含以下内容:

input {
file {
path => "C:\Elk\apache.log"
start_position => "beginning"
    }
}

output {
elasticsearch { hosts => ["localhost:9200"] }
}

然后我重新启动了我的Logstash服务,现在希望看看elasticsearch是否正在索引我的日志内容 . 我该怎么做呢?

1 回答

  • 2

    尝试将以下行添加到logstash conf中,并告知我们是否存在任何grokparsing失败...这意味着您在过滤器部分中使用的模式不正确 .

    output {
      stdout { codec => json }
      file { path => "C:/POC/output3.txt" }
    }
    

相关问题