Logstash-salesforce-input plugin interval refresh

Hi i have the same issue than @mPanasiewicz.
Is there any way to refresh salesforce with a cron exp

Continuing the discussion from Logstash-salesforce-input plugin interval refresh:

Thanks in advance

Hi @Samuele_Lolli,

Doesn't look like the salesforce input plugin supports a cron setting like some of the other inputs do, but that doesn't mean you can't use cron at the OS level to the same effect.

If I was going to set it up I'd do the following.

  1. Use crontab to setup a cronjob that runs at the desired frequency.
  2. Create a shell script that runs logstash manually (since the docs above say it won't support polling).

Hi @Wave,
thanks for you reply. This can be a solution but my logstash is running as a service and i donìt know if i can add the pipeline in the logstash service or needs to run outside the service.
What you think about that?

You can keep your logstash running as a service and run a seperate logstash from the command line, just will want to make sure to pass the specific config file to run with the "-f" command line argument. Instead you can also use "-e" if you just want to declare the configuration right there as a string. All the command line options can be found by using:

bin/logstash --help

Thank you again for you response @Wave.
I have found a solution and i want to share it.
I edited the file crontab using crontab -e adding a line like that:

0 * * * * export CURRENT_DATE=`date --iso-8601=seconds -d "-1 hours"`; /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/MYPIPELINE.conf

Using that string every hour a new env variable with the current date minus 1 hour. Then the pipeline is launched.

I check everything is working fine using systemctl status crontab

I hope this can be usefull for someone

1 Like

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