# How can i schedule logstash every two hours for jdbc input plugin?

**URL:** https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973
**Category:** Logstash
**Created:** [May 14, 2021, 5:19am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973 "2021-05-14T05:19:59Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![sreedhar1](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@sreedhar1](https://discuss.elastic.co/u/sreedhar1)
#### Post date: [May 14, 2021, 5:20am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/1 "2021-05-14T05:20:00Z")

</div>

How can i schedule logstash every two hours for jdbc input plugin?

---

<div class="post-metadata">

### Author: ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)
#### Post date: [May 14, 2021, 10:15am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/2 "2021-05-14T10:15:58Z")

</div>

What's your need exactly ?

You should maybe take a look at cron actin on linux

Good luck

---

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [May 14, 2021, 2:07pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/3 "2021-05-14T14:07:57Z")

</div>

The Logstash JDBC input has scheduling built into it see [here](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#_scheduling_2)

---

<div class="post-metadata">

### Author: ![Alexandre.Bernier](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@Alexandre.Bernier](https://discuss.elastic.co/u/Alexandre.Bernier)
#### Post date: [May 14, 2021, 2:19pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/4 "2021-05-14T14:19:55Z")

</div>

Hi!

You could use something like [this](https://crontab.guru/#0_*/2_*_*_*). (0 \*/2 \* \* \*)

Regards,  
Alexandre

---

<div class="post-metadata">

### Author: ![sreedhar1](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@sreedhar1](https://discuss.elastic.co/u/sreedhar1)
#### Post date: [May 19, 2021, 1:03pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/5 "2021-05-19T13:03:32Z")

</div>

This expression not repeating every 2 hours

---

<div class="post-metadata">

### Author: ![sreedhar1](https://avatars.discourse-cdn.com/v4/letter/s/dc4da7/32.png) [@sreedhar1](https://discuss.elastic.co/u/sreedhar1)
#### Post date: [May 21, 2021, 10:40am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/6 "2021-05-21T10:40:01Z")

</div>

Hi Guys,

0 0 \*/2 \* \* \* is worked for me.

Thanks,  
Sree

---

<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: [June 18, 2021, 10:40am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-two-hours-for-jdbc-input-plugin/272973/7 "2021-06-18T10:40:36Z")

</div>

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