# Schedule option with exec module

**URL:** https://discuss.elastic.co/t/schedule-option-with-exec-module/146821
**Category:** Logstash
**Created:** [August 31, 2018, 7:33am UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821 "2018-08-31T07:33:47Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![niraj\_pandey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_pandey/32/44034_2.png) [@niraj\_pandey](https://discuss.elastic.co/u/niraj_pandey)
#### Post date: [August 31, 2018, 7:33am UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/1 "2018-08-31T07:33:47Z")

</div>

[niraj@farmdev02 ~]$ sudo /usr/share/logstash/bin/logstash -f /tmp/cloud-cost.conf -t

netflow", :directory=\>"/usr/share/logstash/modules/netflow/configuration"}  
[WARN] 2018-08-31 00:27:30.366 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified  
**[ERROR] 2018-08-31 00:27:30.641 [LogStash::Runner] exec - Unknown setting 'schedule' for exec**  
**[FATAL] 2018-08-31 00:27:30.644 [LogStash::Runner] runner - The given configuration is invalid. Reason: Something is wrong with your configuration.**  
**[ERROR] 2018-08-31 00:27:30.647 [LogStash::Runner] Logstash - java.lang.IllegalStateException: org.jruby.exceptions.RaiseException: (SystemExit) exit**

Conf file:

input {

exec {

```
 command => '/opt/scripts/cloud_cost/scripts/preprocess-new-version-b.py As'

 schedule => "52 23 * * * America/Los_Angeles"

 codec => "json_lines"

```

}

exec {

```
 command => '/opt/scripts/cloud_cost/scripts/a.py Az'

 schedule => "52 23 * * * America/Los_Angeles"

 codec => "json_lines"

```

}

}

output {  
if [type] == "bill" {  
elasticsearch {  
hosts =\> "ns-ecoordinator"  
index =\> "billing-%{+YYYY.MM}"  
#document\_type =\> "doc"  
}  
}

# stdout { codec =\> rubydebug }

}

---

<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: [August 31, 2018, 8:07am UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/2 "2018-08-31T08:07:53Z")

</div>

I believe the `schedule` option was added recently so you need to upgrade the exec plugin.

---

<div class="post-metadata">

### Author: ![niraj\_pandey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_pandey/32/44034_2.png) [@niraj\_pandey](https://discuss.elastic.co/u/niraj_pandey)
#### Post date: [August 31, 2018, 12:52pm UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/3 "2018-08-31T12:52:31Z")

</div>

Is there any other way I can achieve same with some other option ?

---

<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: [August 31, 2018, 1:03pm UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/4 "2018-08-31T13:03:32Z")

</div>

Would the `interval` option do? Otherwise you'd have to schedule the execution of Logstash itself.

---

<div class="post-metadata">

### Author: ![niraj\_pandey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_pandey/32/44034_2.png) [@niraj\_pandey](https://discuss.elastic.co/u/niraj_pandey)
#### Post date: [September 1, 2018, 6:31am UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/5 "2018-09-01T06:31:13Z")

</div>

Thanks Magnus. Schedule the execution via cron sound good for me.

Thanks  
Nirah

---

<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: [September 29, 2018, 6:31am UTC](https://discuss.elastic.co/t/schedule-option-with-exec-module/146821/6 "2018-09-29T06:31:24Z")

</div>

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