Issue
Now when logstash filter get eof, it seems that logstash filter is running yet, but file doesn't have more logs to output to elasticsearch index.
How can i get out of logstash filter when it's the end of file (eof), to do another tasks?
Solution
I solve the problem using exec on output of logstash filter, and create a bash script to kill logstash process.
In logstash filter:
input
{
...
}
filter
{
...
}
output
{
exec
{
command => "sh kill_logstash.sh"
}
...
}
In bash script (kill_logstash.sh):
#!/bin/bash
echo 'Terminou a leitura do ficheiro'
pkill -f logstash
exit 0
Same Problem: How to automatically kill a logstash agent when tests are done?
Answered By - Miguel Bessa Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.