PREVIOUS my.app

NEXT test.drop

social.salesforce

Tag structure

The logs from Salesforce are labeled with the social.salesforce.opportunity tag.
  • Devo will use the object structure defined here. Contact us if you need to add specific columns to the parser.
  • For more information on how tags work, check the Introduction to tags article.

Salesforce configuration

You must have administrator privileges to carry out the following steps.

  1. Select Setup in the top right part of the screen.

  2. Go to Apps → App Manager.

  3. Click New Connected App and fill out the basic information needed for the app to work:
    • Connected App Name - name of the new connected app (e.g. ELK).
    • API Name - name of the API to be used by the connecting program (e.g. ELK).
    • Contact Email - an email address that Salesforce can use to contact you.
    • Select the Enable OAuth Setting checkbox and enter the following information:
      • Callback URL - You can enter http://localhost/ since the Logstash plugin will be using password authentication.
    • Selected OAuth Scopes - Add Full Access (full) to the list.

    When done, click Save. The new app is added and displayed.

  4. Note down the fields Consumer Key and Consumer Secret, since you will need them later when configuring Logstash. Right-click the app and click View to access them.

  5. If you do not have a Salesforce token, click Reset Security Token to create one. You will receive an email in a couple of minutes.

In-house Relay configuration

You need to download and install the Logstash agent to consume Salesforce data through API. Execute the following commands in the relay using the root user:

  • wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -




  • apt-get install apt-transport-https


  • echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list


  • apt-get update && apt-get install logstash


  • systemctl stop logstash.service
  • /usr/share/logstash/bin/logstash-plugin install logstash-output-syslog


  • /usr/share/logstash/bin/logstash-plugin install logstash-input-salesforce


  • Modify the following file with your Salesforce information and copy it in /etc/logstash/conf.d/ as salesforce.conf

    input {
       salesforce {
          client_id => '#########' #Salesforce consumer key
          client_secret => '######' #Salesforce consumer secret
          username => '####@logtrust.com' #the email address used to authenticate
          password => '#######' #the password used to authenticate
          security_token => '#########' #Salesforce security token
          sfdc_object_name => 'Opportunity' #Salesforce object to track
       }
    }
    output {
              syslog {
                    facility => "local7"
                    host => "localhost"
                    port => "13000"
                    severity => "informational"
                    appname => "social.salesforce.opportunity"  #Here we put the tag
                    protocol => "tcp"
    		            codec => line {
                            format => "%{AccountId};%{Amount};%{CampaignId};%{CloseDate};%{ConnectionReceivedId};%{ConnectionSentId};%{ContractId};%{CurrencyIsoCode};%{Description};%{ExpectedRevenue};%{Fiscal};%{FiscalQuarter};%{FiscalYear};%{ForecastCategory};%{ForecastCategoryName};%{HasOpenActivity};%{HasOpportunityLineItem};%{HasOverdueTask};%{IsClosed};%{IsDeleted};%{IsExcludedFromTerritory2Filter};%{IsSplit};%{IsWon};%{LastActivityDate};%{LastReferencedDate};%{LastViewedDate};%{LeadSource};%{Name};%{NextStep};%{OwnerId};%{Pricebook2Id};%{PricebookId};%{Probability};%{RecordTypeId};%{StageName};%{SyncedQuoteID};%{Territory2Id};%{TotalOpportunityQuantity};%{Type}"
                            }
                }
    }

  • Edit crontab with:

    crontab –e and add 0 0 * * * /usr/share/logstash/bin/logstash -f /etc/logstash/conf.d/salesforce.conf -w 4

     This will pull data once a day at 00:00.

Have we answered your question?

If not, please contact our technical support team via email by clicking the button below.

CONTACT US

PREVIOUS my.app

NEXT test.drop