# Do I need to run in background logstash process for schedule jdbc input plugin?

**URL:** <https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714>\
**Category:** Logstash\
**Created:** [June 22, 2016, 9:53pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714 "2016-06-22T21:53:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![metload](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@metload](https://discuss.elastic.co/u/metload)\
**Post date:** [June 22, 2016, 9:53pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/1 "2016-06-22T21:53:49Z")

</div>

Hi everybody

I am trying to run logstash conf file through Jenkins, I am using a jdbc input plugin with a schedule property to run each morning at 6.00 AM and I have a question, Do I need to leave the process run in background (/logstash -f ) to execute the query every morning?.

When the job in jenkins is executed with the schedule property this doesn't finish and I don't know why, but when I remove the schedule property the jobs finish without problem.

Somebody can explain me how the schedule property works ?

---

<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 23, 2016, 4:41am UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/2 "2016-06-23T04:41:04Z")

</div>

If you use Logstash's schedule option it'll run forever and periodically fetch from the database. That's not suitable for executable via Jenkins. So, either use Jenkins's schedule feature and run Logstash without its schedule feature, or run Logstash outside of Jenkins and rely on Logstash's schedule feature.

---

<div class="post-metadata">

**Author:** ![metload](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@metload](https://discuss.elastic.co/u/metload)\
**Post date:** [June 23, 2016, 5:53pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/3 "2016-06-23T17:53:05Z")

</div>

Thanks for your answer,

I solve this calling sh command in background with Jenkins some like this.

`sh "/opt/logstash/bin/logstash --allow-env -f ${workspace}/src/middleware-logstash.conf &"`

And thats works for me because I needed Jenkins for do others activities 😃

---

<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 29, 2016, 8:23pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/4 "2016-06-29T20:23:18Z")

</div>

What's the point of starting it from Jenkins and running it in the background?

---

<div class="post-metadata">

**Author:** ![metload](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@metload](https://discuss.elastic.co/u/metload)\
**Post date:** [June 30, 2016, 5:37pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/5 "2016-06-30T17:37:19Z")

</div>

The main point is that we implement a java process to export and import kibana dashboards, visualizations and search to JSON files and we can move this to some environments (dev, pre and pro).

when Jenkins runs extract these dashboards and export to required environment and one activity is recycle the process of logstash to execute.

---

<div class="post-metadata">

**Author:** ![metload](https://avatars.discourse-cdn.com/v4/letter/m/85f322/32.png) [@metload](https://discuss.elastic.co/u/metload)\
**Post date:** [June 30, 2016, 5:47pm UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/6 "2016-06-30T17:47:15Z")

</div>

And this is the Kibana project for migrate dashboards

> **[metloadcg/kibana-source-control](https://github.com/metloadcg/kibana-source-control)**
>
> kibana-source-control - Kibana Source Control (migrate dashboards to others environments).

---

<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 6, 2017, 4:50am UTC](https://discuss.elastic.co/t/do-i-need-to-run-in-background-logstash-process-for-schedule-jdbc-input-plugin/53714/7 "2017-07-06T04:50:05Z")

</div>


