# Schedule job for elasticsearch

**URL:** https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079
**Category:** Logstash
**Created:** [November 17, 2017, 7:31am UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079 "2017-11-17T07:31:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![prabhu\_pandurangan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prabhu_pandurangan/32/24363_2.png) [@prabhu\_pandurangan](https://discuss.elastic.co/u/prabhu_pandurangan)
#### Post date: [November 17, 2017, 7:31am UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079/1 "2017-11-17T07:31:11Z")

</div>

Hi Team

i would like to setup schedule job for elasticsearch input plugin? how to do it?

---

<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: [November 17, 2017, 7:35am UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079/2 "2017-11-17T07:35:25Z")

</div>

There's nothing built-in for this (see [https://github.com/logstash-plugins/logstash-input-elasticsearch/issues/32](https://github.com/logstash-plugins/logstash-input-elasticsearch/issues/32)) but you can always fire up Logstash via crontab.

---

<div class="post-metadata">

### Author: ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)
#### Post date: [November 17, 2017, 3:15pm UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079/3 "2017-11-17T15:15:27Z")

</div>

I have a customized plugin to do that  
I can do a fork in github if you want to build on it

---

<div class="post-metadata">

### Author: ![franck.lefebure](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/franck.lefebure/32/24332_2.png) [@franck.lefebure](https://discuss.elastic.co/u/franck.lefebure)
#### Post date: [November 17, 2017, 4:10pm UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079/4 "2017-11-17T16:10:57Z")

</div>

So it won't be lost.. : [GitHub - flefebure/logstash-input-elasticsearch](https://github.com/flefebure/logstash-input-elasticsearch)  
It's inspired from logstash input jdbc plugin

configuration example :

> elasticsearch {  
> hosts =\> "forge.local"  
> record\_last\_run =\> true  
> tracking\_field =\> "computation"  
> last\_run\_metadata\_path =\> "/etc/logstash/states/my.state"  
> query =\> '{"query":{"query\_string":{"query":  
> "+\_type:activity +computation:\>=&elastic\_last\_value +computation:\<now-1h"}},  
> "sort": ["computation"]}'  
> size =\> 1000  
> index =\> "index\_201710,index\_201711"  
> schedule =\> "\* \* \* \* \*"  
> legacy\_scrolling =\> true  
> }

legacy\_scrolling is to scroll data from ES1.x server

---

<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: [December 15, 2017, 4:23pm UTC](https://discuss.elastic.co/t/schedule-job-for-elasticsearch/108079/6 "2017-12-15T16:23:11Z")

</div>

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