You can increase close_timeout
by setting it in your prospector.
E.g. you can increase it to 10 minutes instead of the default 5 minutes.
filebeat.prospectors:
- input_type: log
close_inactive: 10m
See more on this option: https://www.elastic.co/guide/en/beats/filebeat/master/configuration-filebeat-options.html#close-inactive