I have cron scheduled jobs, which would append the data into Elasticsearch indexes. The scheduled job is supposed to run on daily basis. I have different set of files to load. So I need to know, how we can stop the Logstash automatically once the job is complete and start picking the next files to load into ES.
Logstash is not designed to work this way. It expects to keep running forever waiting for additional lines to be appended to a file, or for new files to appear. You would have to do something external to logstash to kill the cron job when you can see all of the data has been loaded to elasticsearch.
One exception would be if you can use a stdin input, which will terminate logstash when it reaches EOF.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.