# How to set the scheduler of JDBC from the INPUT plugin to every 5 seconds

**URL:** https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164
**Category:** Logstash
**Created:** [October 4, 2016, 1:39pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164 "2016-10-04T13:39:24Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)
#### Post date: [October 4, 2016, 1:39pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/1 "2016-10-04T13:39:24Z")

</div>

Original doc :Schedule of when to periodically run statement, in Cron format  
for example: "\* \* \* \* \*" (execute query every minute, on the minute)

Is there any way to narrow down the period to 5 seconds?

Thanks.

---

<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: [October 9, 2016, 2:38pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/2 "2016-10-09T14:38:30Z")

</div>

I don't think that's possible.

---

<div class="post-metadata">

### Author: ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)
#### Post date: [October 9, 2016, 3:41pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/3 "2016-10-09T15:41:29Z")

</div>

Logstash use rufus-scheduler in which I find out the code that can support the second-base cron.

> **[jmettraux/rufus-scheduler](https://github.com/jmettraux/rufus-scheduler/)**
>
> rufus-scheduler - scheduler for Ruby (at, in, cron and every jobs)

  
I'll give it a shoot.

Thanks anyway.

---

<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: [October 9, 2016, 5:38pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/4 "2016-10-09T17:38:05Z")

</div>

Yes, rufus-scheduler itself supports second resolution but I see no signs that the cron syntax does.

---

<div class="post-metadata">

### Author: ![xiaozhuqq48](https://avatars.discourse-cdn.com/v4/letter/x/97f17d/32.png) [@xiaozhuqq48](https://discuss.elastic.co/u/xiaozhuqq48)
#### Post date: [October 10, 2016, 4:09am UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/5 "2016-10-10T04:09:31Z")

</div>

> **[jmettraux/rufus-scheduler](https://github.com/jmettraux/rufus-scheduler/tree/master/lib/rufus/scheduler)**
>
> rufus-scheduler - scheduler for Ruby (at, in, cron and every jobs)

  
There is a cronline.rb, which supports cron syntax.  
Or am I misunderstanding you?

---

<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: [October 10, 2016, 5:34am UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/6 "2016-10-10T05:34:18Z")

</div>

And how do you specify second resolution with the cron syntax?

---

<div class="post-metadata">

### Author: ![Exocomp](https://avatars.discourse-cdn.com/v4/letter/e/ea5d25/32.png) [@Exocomp](https://discuss.elastic.co/u/Exocomp)
#### Post date: [March 7, 2017, 10:00pm UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/7 "2017-03-07T22:00:30Z")

</div>

Yes it does and it works great, currently using it:

\*/10 \* \* \* \* \*

6 stars is second resolution, above is a 10 second interval example.

---

<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:28am UTC](https://discuss.elastic.co/t/how-to-set-the-scheduler-of-jdbc-from-the-input-plugin-to-every-5-seconds/62164/8 "2017-07-06T04:28:02Z")

</div>


