# How to apply sdfc filter in salesforce plugin of logstash

**URL:** https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736
**Category:** Logstash
**Created:** [November 9, 2020, 11:06am UTC](https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736 "2020-11-09T11:06:30Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Pavitra\_Poojary](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavitra_poojary/32/77753_2.png) [@Pavitra\_Poojary](https://discuss.elastic.co/u/Pavitra_Poojary)
#### Post date: [November 9, 2020, 11:06am UTC](https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736/1 "2020-11-09T11:06:30Z")

</div>

Hi Team,

We are extracting the logs from Salesforce object. Here is our input configuration with a object name Error\_Log\_\_c.

```
input {​
salesforce {​
 use_test_sandbox => true
 client_id => 'xxx'
 client_secret => 'xxx'
 username => ''xxx"
 password => ''xxx"
 security_token => ''xxx"
 sfdc_object_name => ''Error_Log__c"
 #sfdc_filters => "LastModifiedDate > : Datetime.now().addMinutes(-15)"
}​
}​

```

\*\*\* We are getting the LastModifiedDate in our ES output.

We are facing 2 issues here .

1. Data is been fetched from the beginning every time, which is causing duplicate entries.
2. To rectify this, we are trying pass only last modified date in sdfc filters \> last 15 mins. however , this sdfc filter mentioned config is throwing the error.

How could we resolve this issue ?

OR

Is there any other way to taking the max. of last modified date from the index and pass that as a filter value.

How do we schedule this input plugin to execute every 15 minutes to get the latest modified records.

any help would be appreciated !! Thank you .

---

<div class="post-metadata">

### Author: ![brendanlynch](https://avatars.discourse-cdn.com/v4/letter/b/eada6e/32.png) [@brendanlynch](https://discuss.elastic.co/u/brendanlynch)
#### Post date: [November 11, 2020, 7:38pm UTC](https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736/2 "2020-11-11T19:38:55Z")

</div>

I have the same questions. Have you made any progress. I'm just starting to look at this input plugin and I wanted to use it to get most recent changes since last run. I will tell you that the format of you date might matter. This is the format of the date string I needed to use within my salesforce developer console: 2020-10-15T18:56:44.000+0000 . I was hoping this salesforce input plugin had a feature like the JDBC plugin has. JDBC can persist a timestamp so it knows what to use when it polls the next executions.

---

<div class="post-metadata">

### Author: ![Pavitra\_Poojary](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pavitra_poojary/32/77753_2.png) [@Pavitra\_Poojary](https://discuss.elastic.co/u/Pavitra_Poojary)
#### Post date: [November 12, 2020, 5:07am UTC](https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736/3 "2020-11-12T05:07:56Z")

</div>

No, we have not got any solution yet !!

Is there any alternate way to achieve this.. please do let us know

---

<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: [December 10, 2020, 5:08am UTC](https://discuss.elastic.co/t/how-to-apply-sdfc-filter-in-salesforce-plugin-of-logstash/254736/4 "2020-12-10T05:08:04Z")

</div>

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