作为负载测试的一部分,我有几个预制的日志文件来模拟不同的场景。
我正在尝试使用 Logstash 发送 1 个文件的内容,并在每次到达 EOF 时循环重新发送。
我有办法做到这一点吗?
最好使用一个名为
file
的输入插件,这样,Logstash 每次到达末尾时都会从头开始连续读取日志文件!
input {
file {
path => "/path/to/your/log/file.log"
start_position => "beginning"
sincedb_path => "/dev/null"
mode => "read"
file_completed_action => "log_and_continue"
file_completed_log_path => "/path/to/completed/log/file.log"
sincedb_clean_after => "0"
close_older => "0"
stat_interval => "1"
discover_interval => "1"
}
}
output {
#output configuration
}