Skip to main content
Sumo Logic

Collect Logs for the Salesforce App

This page provides instructions for setting up event collection from Salesforce for analysis in Sumo Logic. Click a link to jump to a topic:

Requirements and process overview

Before you begin setting up log collection, review the required prerequisites and process overview described in the following sections.


The Salesforce Event Monitoring add-on is required to obtain all of the data presented in the app dashboards.  The add-on enables access 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.

Process overview

Setting up log collection from Salesforce for analysis in Sumo Logic includes the following tasks, which must be performed in the order in which they are presented.

  1. Set Salesforce permissions.
  2. Download the SumoJanus packages.
  3. Deploy the SumoJanus packages.
  4. Configure the SFDC bundle.
  5. Authenticate with Salesforce.
  6. Install a Sumo collector on your production system
  7. Deploy the configuration on your productions system
  8. Configure a script source

Configuring Salesforce log collection

This section walks you through the process of setting up log collection from Salesforce for analysis in Sumo Logic. Click a link to jump to a topic.

Step 1: Set Salesforce user permissions

To create a permission set and assign it to a user

  1. In Salesforce, go to Setup > Administer > Manage Users > Permission Sets.  
  2. Create a permission set with the API Enabled permission and either the View Event Log Files or the View All Data permission. For more information, see Create Permission Sets in Salesforce help.
  3. On the Permission Set Overview > System Permissions page, select API Enabled and View Event Log Files.
  4. Click the Manage Assignments button in the permission set you just created, and click Add Assignments.
  5. Find your user and assign that user to the permission set you just created.
  6. Save your changes.

Step 2: Download the SumoJanus packages

The following SumoJanus files are required to collect logs from Salesforce. SumoJanus is a proprietary library used for script-based collection from applications such as Okta, Box, and Salesforce.

The SumoJanus package file:

The Salesforce bundle package for SumoJanus:

Step 3: Deploy the SumoJanus packages

The deployment steps vary, depending on whether or not you have set up the SumoJanus package previously. 

If you have never set up SumoJanus 

If you have not previously set up the SumoJanus package, follow these steps.

  1. Copy the two package files you downloaded to the same folder, then unzip them there.

    • On Linux, run the following commands:

      tar xzvf sumojanus-dist.3.0.1.tar.gz
      tar xzvf sumojanus-salesforce-3.1.0.tar.gz

    • On Windows, if your unzip utility prompts you with a merge option, use it to merge the two unzipped files into the directory structure shown in.

Required SumoJanus installation directory structure

Regardless of your operating system, the contents of the archives you unzipped above should have the following merged directory structure within a  sumojanus directory, with all of the files from both packages, like this:


If you have set up SumoJanus previously

If you have previously set up the SumoJanus package, follow these steps.

  1. Backup the file conf/
  2. Copy the sumojanus-3.1.0-salesforce.tar.gz file into the parent folder where SumoJanus is currently installed. (So this folder should contain the folder sumojanus.)
  3. Unzip the file sumojanus-3.1.0-salesforce.tar.gz. This will copy the files from the SFDC bundle package to the folder sumojanus.

Step 4: Configure the SFDC Bundle

  1. Go to the unzipped sumojanus folder.
  2. Open the file conf/ and edit it to add the following section to the end of the file (do not overwrite any existing content in the file):

    url = <Salesforce Instance URL>
    token_file_path = ${path}/data/salesforce.token
    record_file_path = ${path}/data/sf_readfiles.dat
    # if you are using a SFDC sandbox environment, set the following to true
    sandbox = false
    interval = daily

  3. Set the following properties:
    1.  urlPoint to your Salesforce URL. For example:
    2. sandboxIf you are is using a sandbox environment, set the property to true. It is set to false by default.
    3. start_timeIf you don’t specify start_time, logs will be collected from two days in the past.
    4. interval—Controls whether you collect daily or hourly logs. Note that later in this procedure, in  Step 7: Configure a script source, the setting you specify for Frequency, should correspond to the interval setting.

In the file conf/, the following properties are supported.

Property Required or Default Description
url Required Instance URL (for example,
token_file_path Required Path to access token file to authenticate with SFDC API.
convert_csv_to_json Not required, default: true Set to true if output should be in JSON. This is because raw event logs from SF are in CSV format.
record_file_path Not required, default: ${path}/sf_readfiles.dat Path to store list of log event files read successfully.
sandbox Not required, default: false Set to true if the URL points to a sandbox instance.
start_time Not required, default: 2 days ago Milliseconds since the epoch to begin collecting (for example, 1450137600000).
end_time Not required, default: now Milliseconds since the epoch to stop collecting.
interval Not required, default: daily Set to daily or hourly for corresponding log files.

Step 5: Authenticate with Salesforce

  1. Log out of Salesforce. >
  2. Run the following command under the unzipped sumojanus folder:
    • On Unix-like systems: bin/SumoJanus_SF.bash -s
    • On Windows: bin\SumoJanus_SF.bat -s
  3. A browser will open (if it doesn't, see If your browser does not open, below):
    • If your browser has already authenticated with Salesforce, a message will display saying that access has been granted.
    • Otherwise, you will see the Salesforce login. Supply your credentials (with the required permissions) to grant access.
  4. You will then see the following message, which says that the token file has been created:
  5. Don't close the session where you ran bin/SumoJanus_SF.bash -s.
If your browser does not open

If the target environment does not have a GUI, for example if you are remoting into the environment, SumoJanus won't be able to open a browser and will print out a link to the CLI instead. Copy that link and paste into a browser. Then follow the authentication and approval process with Salesforce, until you get a URL back that looks like this:


Your browser will display error messages like those shown below. You can ignore them.


Then open another session to the SumoJanus host, and run this curl command:

curl -X POST '<the_above_url>'

You should see a confirmation that the token file has been created, similar to the one shown in Step 4 above.

Test your configuration
  1. To make sure that the settings are correct, run the following command from the sumojanus folder:
    • On Unix-like systems: bin/SumoJanus_SF.bash
    • On Windows: bin\SumoJanus_SF.bat
    (run the command without the -s flag).
  2. You should see something like this (which may go on for a while):
  3. Remove the sf_readfiles.dat file that was just created. This file should be located under the data folder.

Step 6: Install a Sumo collector on your production system

In Sumo Logic, install a Collector (version i19.115 or later) on the system where you want to collect Salesforce Event Monitoring Logs.

For instructions, see Installed Collectors.

Step 7. Deploy the configuration to your production system

The steps for deploying the configuration to production vary, depending on whether or not SuperJanus 3.0 is already deployed to production.

If you do not have SumoJanus 3.0 on the production system

Copy the whole sumojanus folder to the production system where a Sumo installed collector is configured and running. We recommend putting this folder under the Collector folder.

If you already have SumoJanus 3.0 on the production system

If you are currently using SumoJanus 3.0 on the production system (for example, as part of script collection for another Sumo Logic App, such as Box), this means you already have the sumojanus folder.  

In this case, do the following:

  1. Backup your current version of the conf/ file.
  2. From the conf/ file you configured for Salesforce, copy the new configuration section to the production system.
  3. Unzip only the SFDC bundle, (the sumojanus-salesforce-3.1.0.tar.gz file, or on Windows, ) to the sumojanus folder on your production system.
  4. Copy the token file (salesforce.token) you generated in the Authenticate with Salesforce step into the sumojanus-3.0/data folder.

Step 8. Configure a script source

In Sumo Logic, configure a Script Source using the instructions in Script SourceNew Collectors using version 19.245-4 and later do not allow the creation of Script Sources by default. To allow Script Sources you need to set the Collector parameter enableScriptSource in to true.

For the Sumo Logic App for Salesforce, use the following configuration settings:

  • Frequency. 
    • For daily log files, set frequency to every 6 hours.
    • For hourly log files, set frequency to 1 hour. 
  • Specify a timeout for your command:
    • For daily log files, set timeout to every 3 hours. 
    • For hourly log files, set timeout to 1 hour.
  • Command: /bin/bash
    • On Unix-like systems: /bin/bash
    • On Windows: Windows Script 
  • Type a path to the script to execute:
    • On Unix-like systems: /opt/SumoCollector/sumojanus/bin/SumoJanus_SF.bash
    • On Windows: c:\Program Files\SumoCollector\sumojanus\bin\SumoJanus_SF.bat
  • Working Directory:
    • On Unix-like systems: /opt/SumoCollector/sumojanus
    • On Windows: c:\Program Files\SumoCollector\sumojanus
  • Advanced Options for Logs
    • Timezone: Select "UTC".
    • Timestamp Format: yyyy-MM-dd'T'HH:mm:ss.SSS
    • Timestamp Locator: TIMESTAMP_DERIVED\":\"([^\"]+)\"

Sample log message


Query sample

Most Accessed Reports

_sourceCategory=salesforce event type "Report"
| json "REPORT_ID_DERIVED","REPORT_ID_DERIVED_LOOKUP" as report_id, report_name
| count by report_name, report_id
| format("%s : %s",report_name, report_id) as report_id
| count by report_id 
| sort by _count desc | top 20 report_id by _count