How do I rotate the output log files of logstash

Answering Mark I am sending the data to Elastic and also want to log it somewhere what I have sent , are you saying instead of file plugin I should redirect stdout/error to a file or should try to avoid the whole thing ?

If you care about I/O load then you should avoid it. Not sure why you feel the need to store everything locally when you're already pushing it into Elasticsearch.

Logstash's Debian and RPM packages include a logrotate configuration file that causes /var/log/logstash/logstash.log to get rotated daily with a week's worth of logs kept around.