Schedule option with exec module

[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 }

}

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

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

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

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

Thanks
Nirah

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