# Logstash : run at periodical interval

**URL:** <https://discuss.elastic.co/t/logstash-run-at-periodical-interval/79625>\
**Category:** Logstash\
**Created:** [March 22, 2017, 5:21pm UTC](https://discuss.elastic.co/t/logstash-run-at-periodical-interval/79625 "2017-03-22T17:21:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lemec\_Cinq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lemec_cinq/32/28949_2.png) [@Lemec\_Cinq](https://discuss.elastic.co/u/Lemec_Cinq)\
**Post date:** [March 22, 2017, 5:21pm UTC](https://discuss.elastic.co/t/logstash-run-at-periodical-interval/79625/1 "2017-03-22T17:21:23Z")

</div>

I would like to launch my logstash task at periodical interval:

Do you know if there is a way and if i should add some stuffs to my conf file bellow ?

```
input {
    jdbc {
		jdbc_connection_string => "jdbc:sqlserver://*.*.*.*;databaseName=my_database;"
          jdbc_user => "user"
		  jdbc_password => "my_password"
        jdbc_driver_library => "C:\Program Files (x86)\sqljdbc_6.0\enu\sqljdbc42.jar"
        jdbc_driver_class => "com.microsoft.sqlserver.jdbc.SQLServerDriver"
        statement => "	select t.*from table t where t.timestamp >= sysdate - 5/(24*60) "
    }
}

filter
{
	 ruby {
			code => "event.set('[@metadata][epoch]', event.get('date_launch').getTime)"
		}
		date {
			match => ["[@metadata][epoch]", "UNIX_MS"]
			target => "date_launch"
		}
}

output {

           elasticsearch { 
		   hosts => "localhost:9200"
		   index => "my_index"
		   document_type => "my_type"	
		}
}
```

---

<div class="post-metadata">

**Author:** ![Lemec\_Cinq](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lemec_cinq/32/28949_2.png) [@Lemec\_Cinq](https://discuss.elastic.co/u/Lemec_Cinq)\
**Post date:** [March 22, 2017, 5:39pm UTC](https://discuss.elastic.co/t/logstash-run-at-periodical-interval/79625/2 "2017-03-22T17:39:32Z")

</div>

i did not see schedule param in [jdbc plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html).

It is a solution for my case , but i am still curious to know in all cases

---

<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:** [April 19, 2017, 5:39pm UTC](https://discuss.elastic.co/t/logstash-run-at-periodical-interval/79625/3 "2017-04-19T17:39:37Z")

</div>

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