class LogStash::Inputs::Salesforce

This Logstash input plugin allows you to query Salesforce using SOQL and puts the results into Logstash, one row per event. You can configure it to pull entire sObjects or only specific fields.

NOTE: This input plugin will stop after all the results of the query are processed and will need to be re-run to fetch new results. It does not utilize the streaming API.

In order to use this plugin, you will need to create a new SFDC Application using oauth. More details can be found here: help.salesforce.com/apex/HTViewHelpDoc?id=connected_app_create.htm

You will also need a username, password, and security token for your salesforce instance. More details for generating a token can be found here: help.salesforce.com/apex/HTViewHelpDoc?id=user_security_token.htm

In addition to specifying an sObject, you can also supply a list of API fields that will be used in the SOQL query.

Example

This example prints all the Salesforce Opportunities to standard out

source,ruby

input {

salesforce {
  client_id => 'OAUTH CLIENT ID FROM YOUR SFDC APP'
  client_secret => 'OAUTH CLIENT SECRET FROM YOUR SFDC APP'
  username => 'email@example.com'
  password => 'super-secret'
  security_token => 'SECURITY TOKEN FOR THIS USER'
  sfdc_object_name => 'Opportunity'
}

}

output {

stdout {
  codec => rubydebug
}

}