# Execute logstash script as batch

**URL:** <https://discuss.elastic.co/t/execute-logstash-script-as-batch/95236>\
**Category:** Logstash\
**Created:** [July 31, 2017, 7:41pm UTC](https://discuss.elastic.co/t/execute-logstash-script-as-batch/95236 "2017-07-31T19:41:40Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 1, 2017, 7:18pm UTC](https://discuss.elastic.co/t/execute-logstash-script-as-batch/95236/6 "2017-08-01T19:18:35Z")

</div>

Use the stdin input instead of the file input.

Your input should be:

```auto
input { 
    stdin { } 
}

```

Then you will need to use the command that @warkolm posted before.

```auto
type testLog.log | logstash.bat -f myconf.conf 

```

Also, read this topic, it seems to be what you want, maybe it will help: [stop logstash after processing the file.](https://discuss.elastic.co/t/stop-logstash-after-processing-the-file/84959)

---

_[View the full topic](https://discuss.elastic.co/t/execute-logstash-script-as-batch/95236)._
