elasticsearch Logstash不';t将日志发送到elastic(Windows)
我有一个Spring引导应用程序,它将日志生成到一个文件中。 我还运行了弹性搜索(在docker中)、Kibana和Logstash(不在docker中) 这是我的日志存储配置:
elasticsearch Logstash不';t将日志发送到elastic(Windows),
elasticsearch,logstash,logstash-configuration,logstash-file,
elasticsearch,Logstash,Logstash Configuration,Logstash File,我有一个Spring引导应用程序,它将日志生成到一个文件中。 我还运行了弹性搜索(在docker中)、Kibana和Logstash(不在docker中) 这是我的日志存储配置: input { file { type => "java" path => "C:\Users\user\Documents\logs\semblogs.log" start_position => "beginning" } } output { elastic
input {
file {
type => "java"
path => "C:\Users\user\Documents\logs\semblogs.log"
start_position => "beginning"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
}
stdout {
codec => rubydebug
}
}
“弹性”启动并运行。当我检查索引中创建的数据时,如下所示:
http://localhost:9200/logstash-2019.11.04-000001/_search
它表明:
took 0
timed_out false
_shards
total 1
successful 1
skipped 0
failed 0
hits
total
value 0
relation "eq"
max_score null
hits []
在Kibana,我也不能创建索引,它说在elastic中没有数据
我怀疑Logstash没有向Elastic发送任何传入内容,但我不知道为什么。应用程序的日志文件中有日志…尝试更改路径,使用前斜杠
path=>“C:/Users/user/Documents/logs/semblogs.log”
修复此问题。谢谢。但我不明白。据我所知,Windows不会对路径使用前斜杠,对吗?是的,但出于某些原因,logstash文件中的路径
输入有时需要使用前斜杠。