Logstash configuration to delete input files once processed

Got some reference from this link - Deleting log files after they have finished processing
Firstly I tried to do this using Filebeat but then while searching found this above link and tried to do that using Logstash.
Please suggest what\how I could achieve that..?