I want to ingest files on a universal forwarder that are still being written, and to delete them once the file has finished being written to - i.e. no other open file handles. Is this a default behavior?
Basically I want to write a large number of files to disk, and deliberately only keep them open for a short period of time, where short could be a minute, and after that time, a new file would be created, timestamped with a different minute, for example. So I'm ONLY writing them to disk for Splunk to grab hold of them, and once splunk has read the entire file, it'll serve no further purpose. But I want Splunk to delete it when it knows it can (with UseACK enabled etc.). So if Splunk is poorly then the files will just mount up until it can pick up the backlog.
I'm just concerned that the file will be deleted as soon as it reaches the end of the file at a given point in time, and then the rest of the data would be written to a deleted handle? Would Splunk just hang on each file until it is closed? Is there no EOF until that point anyway, or would it always see an EOF if it runs out of data?
You could use the batch input type in Splunk, that will delete the file after reading it. However, you will have to make sure that the files are written slowly elsewhere, and atomically moved into the monitored path after they are finished. Else Splunk could start reading and deleting a partial file.