The problem is "in streaming fashion". If you are writing events in chunks, say 4k chunks, every time the Splunk process hits EOF, it will call that the end of the event. When the next 4k chunk is written, the next event will start where it left off, somewhere in the middle of your event.
I don't know a way around this problem, unfortunately. What Splunk really needs is a setting that says, "don't send the last event until you see this pattern at the beginning of a line." Or after a timeout.
This wouldn't guaruntee anything, since your process could sit on the next chunk until after the timeout, but it would be better than the current behavior.
You also mentioned copy and truncate. If you can get out of that business and simply use dated file names, you will also be better off.
... View more