# How do security teams integrate Salesforce Event Monitoring with external SIEM platforms for real-time threat detection?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, SIEM Integration, Threat Detection

Read it on the site: https://www.forcechallenges.com/interview-questions/how-do-security-teams-integrate-salesforce-event-monitoring-with-external-siem-platforms-for-real-time-threat

## Answer

**Basics:** A SIEM such as Splunk, Microsoft Sentinel, Datadog or QRadar collects logs from many systems and raises alerts. Salesforce activity is one of those sources, and Event Monitoring is how you export it. Salesforce Shield or the Event Monitoring add-on is required for the full set.

**How it works:**
1. Create a dedicated integration user with "View Event Log Files" and, for streams, "View Real-Time Event Monitoring Data".
2. Authenticate with OAuth (JWT bearer is typical) using a connected app or external client app.
3. Batch path: query `EventLogFile` by event type and date, download each CSV from `LogFile`, de-duplicate by file Id and ship to the SIEM.
4. Real-time path: subscribe via Pub/Sub API or CometD to `LoginEventStream`, `ApiEventStream`, `ReportEventStream` and similar.
5. In the SIEM, create detections: new country for an integration user, large export, off-hours API spikes, and access from unknown connected apps.

**Advanced / deep dive:** Many SIEMs have prebuilt connectors (for example a Splunk add-on), so you may not need custom code. Combine with Transaction Security Policies to block actions inside Salesforce, since the SIEM alone only observes. Log files are retained for 30 days in Salesforce, so the SIEM becomes your long-term archive. Watch pull volume, as downloading large daily files uses API calls. Pull hourly files for fresher data, and use real-time streams where seconds matter. Normalize timestamps to UTC, map `USER_ID` and `CLIENT_IP` to identity data, and keep checkpointing so a restart does not duplicate events.

**Code / config example:**
```sql
SELECT Id, EventType, LogDate, Interval, LogFile
FROM EventLogFile
WHERE EventType IN ('Login','API','ReportExport')
AND LogDate = YESTERDAY
-- then GET <LogFile> with the bearer token to download CSV
```

**Hidden gotchas & must-remember points:**
- ELF is not instant. Hourly files still arrive with a delay.
- Retention in Salesforce is 30 days, so missed pulls cannot be recovered after that.
- Real-time streams need a license and permission, and are subject to the event bus retention window.
- Log schemas change. Version your parsers.
- The integration user's own activity can add noise, so tag and exclude it.
- Exporting logs is itself sensitive and should be audited.

**Best practice:** Use a least-privilege integration identity, store a checkpoint per source, and combine SIEM detection with Salesforce-side enforcement.

---
Source: ForceChallenges · last updated 2026-11-02
