File 日志存储未读取文件输入
我对Logstash有个奇怪的问题。我提供了一个日志文件作为logstash的输入。配置如下:File 日志存储未读取文件输入,file,logging,input,elasticsearch,logstash,File,Logging,Input,elasticsearch,Logstash,我对Logstash有个奇怪的问题。我提供了一个日志文件作为logstash的输入。配置如下: input { file { type => "apache-access" path => ["C:\Users\spanguluri\Downloads\logstash\bin\test.log"] } } output { elasticsearch { protocol => "http" host => "10.35.14
input {
file {
type => "apache-access"
path => ["C:\Users\spanguluri\Downloads\logstash\bin\test.log"]
}
}
output {
elasticsearch {
protocol => "http"
host => "10.35.143.93"
port => "9200"
index => "latestindex"
}
}
我已经在运行elasticsearch服务器,并正在验证是否正在使用接收数据
curl查询。问题是,当输入是文件时,没有收到任何数据。但是,如果我将输入更改为stdin{}
,如下所示,它将平稳地发送所有输入数据:
input {
stdin{ }
}
output {
elasticsearch {
protocol => "http"
host => "10.35.143.93"
port => "9200"
index => "latestindex"
}
}
我不知道我会错在哪里。有人能看一下吗?您应该在文件部分下设置开始位置:
start_position => "beginning"
它默认为结束,因此不会读取文件中的任何现有行,只读取新添加的行:
起始位置
Value can be any of: "beginning", "end"
Default value is "end"
选择Logstash最初读取文件的位置:在开始处
或者在最后。默认行为将文件视为实时流和
因此从最后开始。如果有要导入的旧数据,请设置
这是“开始”
此选项仅修改文件不可用的“首次接触”情况
新的和以前没有见过的。如果以前已经看到过文件,则
这个选项没有效果
除了提供的答案外,我还必须将路径从c:\my\path更改为c:/my/path,以便它读取文件。Log stash将发送数据。。只有当您更改文件时。。你改变数据了吗?我是那个日志文件?谢谢,如果可能的话,你能回答我的其他问题吗?