# Run logstash in batch mode + signals?

**URL:** <https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246>\
**Category:** Logstash\
**Created:** [February 16, 2018, 8:32pm UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246 "2018-02-16T20:32:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Brooks](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Jason\_Brooks](https://discuss.elastic.co/u/Jason_Brooks)\
**Post date:** [February 16, 2018, 8:32pm UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246/1 "2018-02-16T20:32:18Z")

</div>

Hello,

I have learned how to do some data conversion with logstash. Eventually, I would like to piggyback tasks on to an existing logstash service, but for now I would like to run logstash on a configuration and exit when complete.

At the moment, I just use ^c to exit logstash when I am done.

OH hey, are there any signals I can send a logstash service to do things like reload configurations, reset file pointers, etc?

--jason

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 19, 2018, 7:19am UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246/2 "2018-02-19T07:19:48Z")

</div>

> I have learned how to do some data conversion with logstash. Eventually, I would like to piggyback tasks on to an existing logstash service, but for now I would like to run logstash on a configuration and exit when complete.

Logstash's file input is geared towards continuous monitoring of input files of unknown length so it doesn't know when it's done.

> OH hey, are there any signals I can send a logstash service to do things like reload configurations, reset file pointers, etc?

You can configure it to automatically reload its configuration when it changes but I don't think SIGHUP etc work.

Not sure exactly what you mean by resetting file pointers but the answer is no.

---

<div class="post-metadata">

**Author:** ![simmel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/simmel/32/48040_2.png) [@simmel](https://discuss.elastic.co/u/simmel)\
**Post date:** [February 19, 2018, 10:13am UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246/3 "2018-02-19T10:13:44Z")

</div>

Use the  
[stdin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-stdin.html)  
plugin and feed logstash the files you want to convert. Logstash will  
stop when stdin get's closed.

```auto
cat one or several files | logstash -f your_config

```

---

<div class="post-metadata">

**Author:** ![Jason\_Brooks](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Jason\_Brooks](https://discuss.elastic.co/u/Jason_Brooks)\
**Post date:** [February 19, 2018, 8:02pm UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246/4 "2018-02-19T20:02:31Z")

</div>

sweet, I will try the stdin method next time around!

--jason

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 19, 2018, 8:07pm UTC](https://discuss.elastic.co/t/run-logstash-in-batch-mode-signals/120246/5 "2018-03-19T20:07:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
