Skip to main content

Salesforce Source

Thumbnail icon

The Salesforce Source provides a secure endpoint to receive event data from the Salesforce through its Rest API. The source securely stores the required authentication, scheduling, and state tracking information.

note

This Source is available in the Fed deployment.

Prerequisites: Generate the Salesforce API token

The Consumer Key and Consumer Secret API tokens from Salesforce are required to configure this source. 

  1. The Salesforce Event Monitoring add-on is required to obtain all of the data presented in the app dashboards.  The add-on enables access to all event types in the Salesforce EventLogFile, the LoginEvent object, Transaction Security, and the Event Monitoring Analytics App. For more information, see Get Started with Event Monitoring and Enable Event Monitoring.

  2. Create a dedicated user and profile for the integration as referred to in Salesforce documentation.

  3. Go to the profile created in Step 1 and provide the following permissions required by the source:

    • Under the Administrative Permissions page, select API Enabled and Password Never Expires, View All Users, View Setup and Configuration
    • Under General User Permissions select  View Event Log Files and Run Reports.
    • Under Standard Object Permissions select Documents.
    • Also if your Salesforce portal requires a single sign on, you need to bypass this user by unchecking the Is Single Sign-On Enabled setting in the profile under the System Permissions group.
  4. Create a Connected App in Salesforce to generate the “Consumer Key” (client_id) and “Consumer Secret” (client_secret) API tokens if these are not already available. To do so:

    • Login to Salesforce.

    • Go to Setup > Platform Tools > Apps > App Manager.

    • Select New Connected App. Enter the following Basic Information.

      • App Name. Enter a name for your connected app name. For Example, Sumo Logic.
      • API Name. It defaults to a version of the app name without spaces. Keep the default value. 
      • Contact Email. Enter your email id.
    • API (Enable OAuth Settings)

      • Make sure Enable OAuth Settings is checked.
      • Provide the  Callback URL, For Example, https://login.salesforce.com/services/oauth2/callback
      • Select OAuth Scope. Access and manage your data (API)
      • Select Save and then Continue.
      • After this step, you will get your Consumer Key ("client_id") and Consumer Secret ("client_secret") which you will use to configure the Salesforce source.
  5. Ensure that you have your Salesforce user token (aka security token) handy as it will be used while configuring the Source.

    • In case, you don’t remember your user token, you can reset it. For more details see the Reset Your Security Token document.
    • When a user resets their password, a new security token is sent automatically to their email address.

Create a Salesforce Source

When you create a Salesforce Source, you add it to a Hosted Collector. Before creating the Source, identify the Hosted Collector you want to use or create a new Hosted Collector. For instructions, see Configure a Hosted Collector.

To configure a Salesforce Source:

  1. In Sumo Logic, select Manage Data > Collection > Collection

  2. On the Collectors page, click Add Source next to a HostedCollector.

  3. Select Salesforce.

    Salesforce.png

  4. Enter a Name for the Source in the Sumo Logic console. The description is optional.**

    IMG.png

  5. For Source Category (Optional), enter any string to tag the output collected from the Source. Category metadata is stored in a searchable field called _sourceCategory.

  6. Forward to SIEM. Check the checkbox to forward your data to Cloud SIEM Enterprise. When configured with the Forward to SIEM option the following metadata fields are set automatically by the integration (Do not include below fields as custom log metadata Fields):

    • _siemVendor: Salesforce
    • _siemProduct: Salesforce
    • _siemFormat: JSON
  7. Fields. Click the +Add Field link to define the fields you want to associate, each field needs a name (key) and value.

    • green check circle.png A green circle with a check mark is shown when the field exists in the Fields table schema.
    • orange exclamation point.png An orange triangle with an exclamation point is shown when the field doesn't exist in the Fields table schema. In this case, an option to automatically add the nonexistent fields to the Fields table schema is provided. If a field is sent to Sumo that does not exist in the Fields schema it is ignored, known as dropped.
  8. SignOn URL. Enter your Sign on URL, e.g. https://login.salesforce.com/services/oauth2/token.

  9. User Name. Enter the username that you used to login to Salesforce.

  10. Password. Enter the password associated with the above username.

  11. Client ID. Enter the Consumer Key of the ConnectedApp. 

  12. Client Secret. Enter the Consumer Secret of the ConnectedApp. 

  13. User Token: Enter the user token.  

  14. Build In Memory Lookup. Keep this checked. This will resolve IDs to human-readable names.

  15. Collection Should begin. Select the time range for how far back you want this source to start collecting data from Salesforce. Options available are: Now, 24 hours ago.

  16. When you are finished configuring the Source, click Submit.

Polling Interval and Salesforce API Rate Limits

During each polling interval, the Salesforce Source will make a Rest API request to Salesforce. Your Salesforce instance will limit the number of calls that can be made based on an API Requests limit, which is based on your subscription plan. The Salesforce API uses paging and a maximum of 2,000 rows are returned at a time.

States

The Salesforce Source reports errors, its health, and initialization status. Other than indicating that the source is healthy, you are also informed, in real-time, if the source is running into trouble communicating with Salesforce REST API, or if there's an error that requires user action indicated by Sumo Logic Health Events.

A Salesforce Source goes through the following states when created:

  1. Pending. Once the Source is submitted, details are stored and the source is placed in a Pending state.
  2. Started. A collection task is created on the hosted collector.
  3. Initialized. Task configuration is complete in Sumo Logic.
  4. Authenticated. The Source has successfully authenticated with Salesforce
  5. Collecting. The Source is actively collecting data from Salesforce.

If the Source has any issues during any one of these states, it is placed in an Error state.

Error_State.png

Hover your mouse over the status icon to view a tooltip with details on the detected issue.

Error_Status.png

When you delete the Source, it is placed in a Stopping state. When it has successfully stopped, it is deleted from your Hosted Collector.

On the Collection page, the Health and Status for Sources is displayed. Use Health Events to investigate issues with collection.

Error Types

When Sumo Logic detects an issue it is tracked by Health Events. The following table shows the three possible error types, the reason the error would occur, if the Source attempts to retry, and the name of the event log in the Health Event Index.

TypeReasonRetriesRetry BehaviorHealth Event Name
ThirdPartyConfigNormally due to an invalid configuration. You'll need to review your Source configuration and make an update.No retries are attempted until the Source is updated.Not applicableThirdPartyConfigError
ThirdPartyGenericNormally due to an error communicating with the third party service APIs.YesThe Source will retry for up to 90 minutes, after which retries will be attempted every 60 minutes.ThirdPartyGenericError
FirstPartyGenericNormally due to an error communicating with the internal Sumo Logic APIs.YesThe Source will retry for up to 90 minutes, after which retries will be attempted every 60 minutes.FirstPartyGenericError

Restarting your Source

If your Source encounters ThirdPartyConfig errors, you can restart it from either the Sumo Logic UI or Sumo Logic API.

UI

To restart your source in the Sumo Logic platform, follow the steps below:

  1. Open the Collection page, and go to Manage Data > Collection > Collection.
  2. Select the source and click the information icon on the right side of the row.
  3. The API usage information popup is displayed. Click the Restart Source button on the bottom left.
    restart-source-button
  4. Click Confirm to send the restart request.
    restart-source-confirm
  5. The bottom left of the platform will provide a notification informing you the request was successful.
    restart-source-initiated

API

To restart your source using the Sumo Management API, follow the instructions below:

  • Method: POST
  • Example endpoint:
    https://api.sumologic.com/api/v1/collectors/{collector_id}/sources/{source_id}/action/restart

Sumo Logic endpoints like api.sumologic.com are different in deployments outside us1. For example, an API endpoint in Europe would begin api.eu.sumologic.com. A service endpoint in us2 (Western U.S.) would begin service.us2.sumologic.com. For more information, see Sumo Logic Endpoints.

JSON Configuration

Sources can be configured using UTF-8 encoded JSON files with the Collector Management API. See how to use JSON to configure Sources for details.

ParameterTypeRequiredDescriptionAccess
configJSON ObjectYesContains the configuration parameters for the Source. 
schemaRefJSON ObjectYesUse {"type":"Salesforce"} for a Salesforce.not modifiable
sourceTypeStringYesUse Universal for a Salesforce Source.not modifiable

The following table shows the config parameters for a Salesforce Source.

ParameterTypeRequired?DefaultDescriptionAccess
nameStringYesType a desired name of the Source. The name must be unique per Collector. This value is assigned to the metadata field _source.modifiable
descriptionStringNonullType a description of the Source.modifiable
categoryStringNonullType a category of the source. This value is assigned to the metadata field _sourceCategory. See best practices for details.modifiable
fieldsJSON ObjectNoJSON map of key-value fields (metadata) to apply to the Collector or Source. Use the boolean field _siemForward to enable forwarding to SIEM.modifiable
passwordStringYesType the Salesforce login password for the username.modifiable
usernameStringYesType the Salesforce login username.modifiable
start_timeStringNoNowType the collection start time. Available options are Now, 24 Hours ago, 2 Days ago, 3 Days ago, 4 Days ago, 5 Days ago.modifiable
client_idStringTrueType in Consumer Key of the ConnectedApp.modifiable
client_secretStringTrueType in Consumer Secret of the ConnectedApp.modifiable
user_tokenStringTrueType in the Salesforce user token.modifiable
inmemory_lookupBooleanFalseTrueSet to true to enable inmemory lookup or to false to disable it.modifiable

Salesforce Source JSON example:

{
"api.version":"v1",
"source":{
"schemaRef":{
"type":"Salesforce"
},
"state":{
"state":"Collecting"
},
"config":{
"signon_url":"https://login.salesforce.com/services/oauth2/token",
"name":"TestSalesforceSrc",
"client_secret":"********",
"description":"Test Salesforce source",
"client_id":"3MVG9VeAQy5y3BQWhBnxmQyadGTCNr2zbO.TEep4g6Wik9ZEdlgREnNrGBs680cYVdTjw8SlWv2qVoNgYGddS",
"user_token":"********",
"inmemory_lookup":true,
"password":"********",
"fields":{
"_siemForward":false
},
"category":"cnc/salesforce_logs",
"username":"testuser@sumologic.com",
"start_time":"24 Hours ago"
},
"sourceType":"Universal"
}
}

Troubleshooting

After you configure your Source, you should check the status of the source in the Collectors page. In case the Source is not functioning as expected, you may see an error next to the Source Category column as shown below: 

salesforce-troubleshooting

The following section details how you can resolve various errors: 

Error: Object type 'Document' is not supported

To resolve this: 

  1. In Salesforce, go to Setup>Administration>Users>Profile>New Profile / Edit Profile.
  2. Under Standard Object Permissions > Documents select Read permission click on the Save button. 
  3. Now assign this profile to the user, whose credentials you have configured as part of the Salesforce Source.

Error : Object type 'Report' is not supported

To resolve this:

  1. Go to Setup>Administration>Users>Profile.
  2. Edit specific Profile which is assigned to the user
  3. Go to: General User Permissions and enable / disable Run Reports. Run Reports should be enabled for access to REPORT

Error : Object type 'EventLogFile' is not supported

To resolve this:

  1. Go to Setup>Administration>Users>Permission Sets.
  2. Create New Permission Set and assign to user or Edit specific Permission Set which is assigned to user
  3. At the bottom click System Permissions
  4. Check API Enabled
  5. Check View Event Log Files
  6. Save it

Error: Object type ‘SetupAuditTrail’ is not supported

To resolve this:

  1. Go to Setup>Administration>Users>Profile.
  2. Edit specific Profile which is assigned to the user
  3. Go to: Administrative Permissions and enable / disable View Setup and Configuration. View Setup and Configuration should be enabled for access to SetupAuditTrail

Error : Token Endpoint must match the format "https://<hostname>/services/oauth2/token". This is due to incorrect source configuration.

To resolve this:

  1. Provide the correct "SignOn Url". 

Error : {"error":"invalid_grant","error_description":"authentication failure"} This is due to incorrect source configuration.

To resolve this:

  1. Provide the correct “User Name”, Password, “User Token”.

Error : {"error":"invalid_client_id","error_description":"client identifier invalid"} This is due to incorrect source configuration.

To resolve this:

  1. Provide the correct “Client ID”.

  Error : {"error":"invalid_client","error_description":"invalid client credentials"} This is due to incorrect source configuration.

To resolve this:

  1. Provide the correct “Client Secret” 

  Error : {"error":"unknown_error","error_description":"retry your request"} This is due to an invalid SignOn Url.

To resolve this:

  1. Change it from login.salesforce.com to <instanceURL>.salesforce.com

Error : MoreMemoryRequired: Available: 100 FileSize: 200.Please create a support ticket.

To resolve this:

  1. Please create a support ticket with sumo logic to increase the memory for your container.
Legal
Privacy Statement
Terms of Use

Copyright © 2023 by Sumo Logic, Inc.