Reputation: 1072
As part of load testing, I have a couple of premade log files that simulate different scenarios.
I'm trying to use Logstash to send the content of 1 file, and resend it again in a loop every time it reaches EOF.
Is there a way for me to do that?
Upvotes: 0
Views: 163
Reputation: 12708
better to use an input plugin, called file
, so with this, Logstash will continuously read the log file from the beginning every time it reaches the end!
input {
file {
path => "/path/to/your/log/file.log"
start_position => "beginning"
sincedb_path => "/dev/null"
mode => "read"
file_completed_action => "delete"
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
}
update
by setting file_completed_action
to "logstash_forward",your file will be sent again to Logstash when it reaches the end!
input {
file {
path => "/path/to/your/log/file.log"
start_position => "beginning"
sincedb_path => "/dev/null"
mode => "read"
file_completed_action => "logstash_forward"
file_completed_log_path => "/path/to/completed/log/file.log"
sincedb_clean_after => "0"
close_older => "0"
stat_interval => "1"
discover_interval => "1"
}
}
Upvotes: 0