Skip to content

Instantly share code, notes, and snippets.

@vector4wang
Last active July 8, 2019 01:34
Show Gist options
  • Save vector4wang/dcc129ead42263fb82c4d5c39d40b7a8 to your computer and use it in GitHub Desktop.
Save vector4wang/dcc129ead42263fb82c4d5c39d40b7a8 to your computer and use it in GitHub Desktop.
[Logstash 每次从头读文件] #Logstash
input {
file {
path => ["/data/test.log"]
start_position => "beginning"
sincedb_path => "/dev/null" ## 主要是这句,sincedb_path 会将每次读取的数据做标识存进日志中,如果日志为空,则认为是最新的数据
}
}
output {
stdout {
codec => rubydebug
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment