Split into two tasks: Use dumpcap to create the capture files Have a second script that watches for new files then processes it with tshark