filebeat run can be executed with the --once flags, that runs filebeat only until all the files have been read, then it stops, is this what you are looking for?
--once Run filebeat only once until all harvesters reach 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.