# How to run Logstash configuration file Background?

**URL:** <https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679>\
**Category:** Logstash\
**Created:** [June 20, 2018, 11:55am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679 "2018-06-20T11:55:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [June 20, 2018, 11:55am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/1 "2018-06-20T11:55:16Z")

</div>

Hi All...

I have conf file and I need to run for every 5 minutes automatically

---

<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:** [June 20, 2018, 1:55pm UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/2 "2018-06-20T13:55:59Z")

</div>

What's in the configuration file?

---

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [June 21, 2018, 4:58am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/3 "2018-06-21T04:58:54Z")

</div>

Let Say in ubuntu we have a concept called cronjob right.In windows how we need to run the configuration file in background

---

<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:** [June 21, 2018, 6:13am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/4 "2018-06-21T06:13:24Z")

</div>

If you want help you need to answer my questions.

---

<div class="post-metadata">

**Author:** ![AurelienG](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@AurelienG](https://discuss.elastic.co/u/AurelienG)\
**Post date:** [June 21, 2018, 9:08am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/5 "2018-06-21T09:08:33Z")

</div>

Can't you just add a schedule with cron in Logstash input?

---

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [June 21, 2018, 10:09am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/6 "2018-06-21T10:09:30Z")

</div>

In Configuration file I have sql jdbc input plugin and output to elasticsearch.So I need to run in background for every 5 minutes.

---

<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:** [June 21, 2018, 10:26am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/7 "2018-06-21T10:26:36Z")

</div>

Use the `schedule` option of the jdbc input to run the query every five minutes.

As for running Logstash in the background look into running it as a service. I believe NSSM can help out.

---

<div class="post-metadata">

**Author:** ![kartheek91](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@kartheek91](https://discuss.elastic.co/u/kartheek91)\
**Post date:** [June 21, 2018, 10:57am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/8 "2018-06-21T10:57:57Z")

</div>

K thanks @magnusbaeck I will give it a try

---

<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:** [July 19, 2018, 11:03am UTC](https://discuss.elastic.co/t/how-to-run-logstash-configuration-file-background/136679/9 "2018-07-19T11:03:36Z")

</div>

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