0

In the previous version of my logstash yaml file I used schedule => "* * * * *"

Now I'm trying to schedule it to tqice a day ( lets say 6 am and pm ), but it doesn`t work anymore. File content:

input {
  jdbc{
      clean_run => true
        jdbc_driver_library => "../config/postgresql-42.2.23.jar"
        jdbc_driver_class => "org.postgresql.Driver"
        trigger => {
            schedule => 
                daily => 
                    at => [ "18:00","06:00"]
            }

        statement => 'SELECT tenant_id as id , full_name , email , phone FROM public."Tenants" '
        use_column_value => true
        tracking_column => "id"
  }
}

output {
  elasticsearch {
...
  }
}
Afik Menashe
  • 77
  • 1
  • 1
  • 8
  • 1
    From where did you get this `trigger` option? This does not exist, you need to use [schedule](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-jdbc.html#plugins-inputs-jdbc-schedule) option. To run it twice you will need two `jdbc` input, one configured to run `06:00` and other configured to run `18:00`. – leandrojmp Aug 30 '21 at 14:53
  • Are you sure you cannot use "0 0 6,18 * *"? – Badger Aug 30 '21 at 18:33
  • @Badger didn`t try yet. , will try it. – Afik Menashe Aug 31 '21 at 09:09
  • @leandrojmp from the ES docs, but i tried without the `trigger` , are you sure about the 2 jdbc? i say many kinds of scheduler options... – Afik Menashe Aug 31 '21 at 09:11

1 Answers1

1

So I found the problem, there are no trigger, daily and at properties.

It should simply be: schedule => "0 0 6,18 * * *"

JW Geertsma
  • 857
  • 3
  • 13
  • 19
Afik Menashe
  • 77
  • 1
  • 1
  • 8