我在Windows上安装了ELK堆栈并配置了Logstash以读取Apache日志文件。我似乎无法在Elasticsearch中看到输出。我是ELK堆栈的新手。
环境设置
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是否正在索引我的日志内容。我该怎么做呢?
答案 0 :(得分:2)
尝试在logstash conf中添加以下行,并告知我们是否存在任何grokparsing失败...这意味着您在过滤器部分中使用的模式不正确..
output {
stdout { codec => json }
file { path => "C:/POC/output3.txt" }
}