Salesforce Source
The Salesforce Source collects Login History, Setup Audit Trail, and Event Log File data from a Salesforce org. Cribl Stream queries the Salesforce REST API on a schedule with a connected app.
Type: Pull | TLS Support: Yes | Event Breaker Support: Yes
TLS is enabled through HTTPS on the Salesforce API.
Prerequisites
Create a Salesforce connected app and collect its OAuth client ID and client secret. Event Log File collection requires the Event Monitoring (Shield) add-on.
Additionally, this Source needs an active Leader for job management.
Configure a Salesforce Source
- On the top bar, select Products, and then select Cribl Stream. Under Worker Groups, select a Worker Group. Next, you have two options:
- To configure via QuickConnect, navigate to Routing > QuickConnect. Select Add Source and select Salesforce from the list, choosing either Select Existing or Add New.
- To configure via the Routes, select Data > Sources. Select Salesforce. Next, select Add Source.
- In the New Source modal, configure the following under General Settings:
- Input ID: Enter a unique name to identify this Salesforce Source definition. If you clone this Source, Cribl Stream adds
-CLONEto the original Input ID. - Description: Optionally, enter a description.
- Salesforce subdomain: Enter the My Domain prefix. Use
mycompanyfor production,mycompany.sandboxfor a sandbox, ormycompany.developfor a developer org. - Cloud: Select the domain suffix. Defaults to
.my.salesforce.com. Use.my.salesforce.milfor the military cloud, or enter a custom suffix. - OAuth client ID: Enter the client ID from the connected app.
- OAuth client secret (text secret): Select or create a stored text secret that contains the connected app client secret.
- API version: Salesforce REST API version. Defaults to
v64.0. - Tags: Metadata tags used for categorization and filtering in the Cribl Stream UI. These tags aren’t added to processed events. Use a tab or hard return between tag names.
- Input ID: Enter a unique name to identify this Salesforce Source definition. If you clone this Source, Cribl Stream adds
- Under Content Types, configure the data to collect.
- Optionally, you can adjust the Processing, Retries, and Advanced settings, or Connected Destinations.
- Select Save, then Commit & Deploy.
Content Types
Each content type has its own schedule. LoginHistory and SetupAuditTrail are on by default. EventLogFile is off by default. Select Add Type to add a content type.
| Content type | What it collects | Default state |
|---|---|---|
LoginHistory | User login activity, including IP address, browser, platform, and authentication result. Object is LoginHistory. Cursor field is LoginTime. | On |
SetupAuditTrail | Administrative changes to org configuration and security settings. Object is SetupAuditTrail. Cursor field is CreatedDate. | On |
EventLogFile | Hourly CSV logs of platform events. Requires Event Monitoring (Shield). Object, Fields, Cursor field, and Filter (advanced) are hidden. | Off |
LoginHistory and SetupAuditTrail prefill Object, Fields, and Cursor field. Configure the following settings. EventLogFile hides Object, Fields, Cursor field, and Filter (advanced).
- Content type: Name for a content type you add.
- Object: Salesforce object API name, such as
LoginHistoryorAccount. - Fields: Field API names to include. At least one field is required.
- Cursor field: Timestamp field used for the time filter, such as
LoginTimeorCreatedDate. Include this field in Fields, or Cribl Stream rejects the configuration when you save. - Filter (advanced): Optional Cribl expression that evaluates to a SOQL condition. Wrap the value in backticks, for example
`CountryIso = 'US'`. Cribl Stream evaluates the expression once when the Source initializes. Cribl Stream builds theWHEREclause from the cursor time range, wraps the condition in parentheses, and adds it withAND. AnORstays inside those parentheses and doesn’t replace the time range. Cribl Stream rejectsWHERE,ORDER BY, andLIMITwhen you save. Invalid SOQL fails when the collection runs. - Cron schedule: Defaults to
*/5 * * * *. - Earliest and Latest: Defaults to
-7d@dandnow. - Job timeout: Defaults to
60m. Enter0for unlimited time. - State tracking: Track collection progress between scheduled runs. Defaults to toggled on. When toggled on, the following settings appear:
- Manage State: View, modify, or delete the collection state. See Manage State.
- State update expression: JavaScript expression that updates the saved state from an event. Defaults to
typeof _time === 'number' && !isNaN(_time) && {latestTime: (state.latestTime || 0) > _time ? state.latestTime : _time}. - State merge expression: JavaScript expression that chooses which state to keep. Defaults to
(prevState.latestTime || 0) > newState.latestTime ? prevState : newState.
Processing Settings
Event Breakers
Event Breaker rulesets: Rulesets applied, in order, to the collected data. Defaults to Salesforce Ruleset.
Event Breaker buffer timeout (ms): How long the Event Breaker waits for new data before flushing the stream. Defaults to 10000.
Fields
In this section, you can define new fields or modify existing ones using JavaScript expressions, similar to the Eval function.
- The Field Name can either be a new field (unique within the event) or an existing field name to modify its value.
- The Value is a JavaScript expression (enclosed in quotes or backticks) to compute the field’s value (can be a constant). Select this field’s advanced mode icon (far right) if you’d like to open a modal where you can work with sample data and iterate on results.
This flexibility means you can:
- Add new fields to enrich the event.
- Modify existing fields by overwriting their values.
- Compute logic or transformations using JavaScript expressions.
Pre-Processing
Auto parse: Toggle on to detect each event’s Datatype and extract top-level fields from _raw before Source Fields and before the pre-processing Pipeline or Pack. The toggle is off by default. Because Fields runs after automatic parsing, values you add there take precedence over same-named fields extracted from _raw. For Datatypes that automatic parsing can detect, see the List of Stock v2 Datatypes. For field behavior, prevention of duplicate parsing, and performance considerations, see Automatic Parsing.
Pipeline: Select an existing Pipeline or Pack to process data from this Source before routing.
Retries
Adjust how failed HTTP requests are retried.
Retry type: Defaults to Backoff.
Initial retry interval (ms): Defaults to 1000. Maximum 20000.
Retry limit: Defaults to 5.
Backoff multiplier: Defaults to 2.
Retry HTTP codes: Defaults to 429 and 503.
Honor Retry-After header: Defaults to toggled on. Cribl Stream caps the delay at 20 seconds.
Retry connection timeout: Toggle on to retry once after a connection timeout (ETIMEDOUT). Defaults to toggled off.
Retry connection reset: Toggle on to retry after a connection reset (ECONNRESET). Defaults to toggled off.
Advanced Settings
Max pages per collection: Maximum pages to fetch per content type on a scheduled run. Defaults to 50. Enter 0 for unlimited pages.
Request timeout (seconds): HTTP inactivity timeout. Defaults to 60. Enter 0 to disable the timeout. Maximum 2400.
Time to live: How long to keep the job’s artifacts on disk after the job finishes. Defaults to 4h.
Environment: If you’re using GitOps, optionally use this field to specify a single Git branch on which to enable this configuration. If empty, the configuration is enabled everywhere.
Connected Destinations
Select Send to Routes to enable conditional routing, filtering, and cloning of this Source’s data via the Routing table.
Select QuickConnect to send this Source’s data to one or more Destinations via independent, direct connections.
Troubleshooting
The Source’s configuration modal has helpful tabs for troubleshooting:
Live Data: Try capturing live data to see real-time events as they are ingested. On the Live Data tab, click Start Capture to begin viewing real-time data.
Logs: Review and search the logs that provide detailed information about the ingestion process, including any errors or warnings that may have occurred.
You can also view the Monitoring page that provides a comprehensive overview of data volume and rate, helping you identify ingestion issues. Analyze the graphs showing events and bytes in/out over time.