# Logstash-salesforce-input plugin interval refresh

**URL:** <https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470>\
**Category:** Logstash\
**Created:** [October 20, 2023, 2:12pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470 "2023-10-20T14:12:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuele\_Lolli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_lolli/32/107848_2.png) [@Samuele\_Lolli](https://discuss.elastic.co/u/Samuele_Lolli)\
**Post date:** [October 20, 2023, 2:12pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/1 "2023-10-20T14:12:35Z")

</div>

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](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/109830):

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [October 25, 2023, 5:16pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/2 "2023-10-25T17:16:37Z")

</div>

Hi @Samuele_Lolli,

Doesn't look like the [salesforce input plugin](https://www.elastic.co/guide/en/logstash/current/plugins-inputs-salesforce.html) 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).

---

<div class="post-metadata">

**Author:** ![Samuele\_Lolli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_lolli/32/107848_2.png) [@Samuele\_Lolli](https://discuss.elastic.co/u/Samuele_Lolli)\
**Post date:** [October 26, 2023, 9:59am UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/3 "2023-10-26T09:59:22Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Wave](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wave/32/117242_2.png) [@Wave](https://discuss.elastic.co/u/Wave)\
**Post date:** [October 26, 2023, 2:47pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/4 "2023-10-26T14:47:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Samuele\_Lolli](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samuele_lolli/32/107848_2.png) [@Samuele\_Lolli](https://discuss.elastic.co/u/Samuele_Lolli)\
**Post date:** [October 27, 2023, 1:15pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/5 "2023-10-27T13:15:45Z")

</div>

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:

```auto
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

---

<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:** [November 24, 2023, 1:16pm UTC](https://discuss.elastic.co/t/logstash-salesforce-input-plugin-interval-refresh/345470/6 "2023-11-24T13:16:05Z")

</div>

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