Fix/refactor file output

This will need reviews, It used a similar behavior on failure than the grok filter.

I agree, he will get the same benefits.