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

**URL:** https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393
**Category:** Logstash
**Created:** [August 14, 2015, 12:16pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393 "2015-08-14T12:16:47Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [August 14, 2015, 12:16pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/1 "2015-08-14T12:16:47Z")

</div>

Hi All

I am using this configuration for jdbc input plugin

schedule =\> "\* \* \* \* \*"

How I can schedule logstash for every 1 second or 2 second?

Regards  
Ritesh

---

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [August 17, 2015, 12:31pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/2 "2015-08-17T12:31:41Z")

</div>

Has no one used jdbc logstash plugin?

---

<div class="post-metadata">

### Author: ![michaellizhou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michaellizhou/32/4143_2.png) [@michaellizhou](https://discuss.elastic.co/u/michaellizhou)
#### Post date: [September 4, 2015, 2:02pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/3 "2015-09-04T14:02:18Z")

</div>

Ritesh,

The current schedule config that you have is for every second. For every 2 seconds I believe you just use '2 \* \* \* \* '

rufus-scheduler is a good guide to get the correct time take a look on git

---

<div class="post-metadata">

### Author: ![Pragmateek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pragmateek/32/8884_2.png) [@Pragmateek](https://discuss.elastic.co/u/Pragmateek)
#### Post date: [April 4, 2016, 5:57pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/4 "2016-04-04T17:57:35Z")

</div>

The Cron format has been extended to support seconds :  
"\* \* \* \* _" means every minute  
"_ \* \* \* \* _" means every second  
"_/2 \* \* \* \* \*" means every 2 seconds  
Hope this helps...

---

<div class="post-metadata">

### Author: ![sombilat](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sombilat](https://discuss.elastic.co/u/sombilat)
#### Post date: [May 30, 2016, 2:28pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/5 "2016-05-30T14:28:52Z")

</div>

Hi Guys,

How do I get it for every 24 hours?

I tried both lines below:

- 
  - 
    - \*/24  
\*/24 \* \* \*

But none worked, it said it was a bad cronline in the output.

Thanks,

---

<div class="post-metadata">

### Author: ![alaviamir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alaviamir/32/10167_2.png) [@alaviamir](https://discuss.elastic.co/u/alaviamir)
#### Post date: [June 6, 2016, 2:48pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/6 "2016-06-06T14:48:13Z")

</div>

"30 4 \* \* \*"  
Run every day at 4:30AM

"0 0 \* \* \*"  
Run every day at 12:00AM

"59 23 \* \* \*"  
Run every day at 11:59PM

"0 12 \* \* \*"  
Run every day at 12:00PM

---

<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:20pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/7 "2016-10-04T13:20:58Z")

</div>

Hi, rkhapre:  
Did you solve this problem? How?  
I have the same issue now. I have to narrow down the period to every 5 seconds.

Hope to hear from you, thanks.

---

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [October 5, 2016, 9:27pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/8 "2016-10-05T21:27:27Z")

</div>

Hi

5 star means every 1 second

`schedule => "* * * * *"`

for every 5 second use this

`schedule => "5 * * * *"`

---

<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 6, 2016, 8:37am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/9 "2016-10-06T08:37:15Z")

</div>

Thanks. I found out in the code, \*/5 \* \* \* \* \* means every 5 seconds.  
And what version of Logstash are you using?

PS: it 'handles crontab steps syntax in six-field forms' do  
expect(Rufus::Scheduler::CronLine.new(  
'\*/10 \* \* \* \* _').frequency).to eq(10)  
expect(Rufus::Scheduler::CronLine.new(  
'_ \*/10 \* \* \* _').frequency).to eq(1) # "_" all seconds [0..59]  
expect(Rufus::Scheduler::CronLine.new(  
'0 \*/10 \* \* \* \*').frequency).to eq(10 \* 60)  
end

```
      end
```

---

<div class="post-metadata">

### Author: ![Thangaraj\_Muruganant](https://avatars.discourse-cdn.com/v4/letter/t/74df32/32.png) [@Thangaraj\_Muruganant](https://discuss.elastic.co/u/Thangaraj_Muruganant)
#### Post date: [March 15, 2017, 8:18am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/10 "2017-03-15T08:18:59Z")

</div>

schedule =\> "\*/5 \* \* \* \* \* " for every 5 seconds

schedule =\> "\* \* \* \* \* \* " Loads every second

hope you got the difference..

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [March 15, 2017, 2:26pm UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/11 "2017-03-15T14:26:33Z")

</div>

You can't just add another star and take minute resolution down to seconds. Not with cron syntax.

This plugin uses the rufus-scheduler module in cron mode. You can schedule down to the minute (5 fields) just like cron, but not seconds.

Want a query to run every second? Currently this plugin does not allow for that.

---

<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:27am UTC](https://discuss.elastic.co/t/how-can-i-schedule-logstash-every-second-for-jdbc-input-plugin/27393/12 "2017-07-06T04:27:48Z")

</div>


