How to detect when the input data is finished

I am using Logstash from the cmd line with file input and using cat to push new data to the input file. I need to be able to detect when the input is finished so that I can kill the Logstash instance.

If you are using cat then it should shutdown as soon as it has processed.

If you're using the stdin input Mark's answer applies. For monitoring the progress of a file input see