Filebeat isn`t collecting logs of short living containers like cronjobs.
We are using filebeat version 7.9.3 and also kubernetes autodiscovery.
I've created a cronjob which prints just one line and exits afterwards.
It looks like filebeat receives first an kubernetes pending event (No action is taken if a pending event is coming in, read from source code and logs) and the second time it receives the PodSucceeded (stop event gets emitted, read from source code and logs) event.
Therefore the registry gets cleaned before filebeat is reading the file and the log entry never appears in Kibana.
If I pause the container for 2 seconds before shutting down, the log appears in Kibana.
Do you have any workaround for this kind of issue?