# What operational visibility do Event Monitoring log files provide to security teams auditing integration activity?

**Topic:** Integration · **Difficulty:** Medium · **Tags:** Integration, Event Monitoring, Security Auditing

Read it on the site: https://www.forcechallenges.com/interview-questions/what-operational-visibility-do-event-monitoring-log-files-provide-to-security-teams-auditing-integration

## Answer

**Basics:** Standard auditing, such as Setup Audit Trail or Field History, shows what changed. Event Monitoring shows how the org was used. It is licensed as part of Salesforce Shield or as a separate Event Monitoring add-on, and a small set of login and logout log files is available free (verify the current free allowance).

**How it works:** There are two delivery models.
1. Event Log Files (ELF): a daily file, and an hourly file for many event types, exposed through the `EventLogFile` object. You query it with SOQL or REST, then download the CSV from the `LogFile` field. Typical event types are `API`, `Login`, `Logout`, `ReportExport`, `RestApi`, `BulkApi` and `ApexExecution`. Files are retained for 30 days.
2. Real-time Event Monitoring: streaming events (`LoginEventStream`, `ApiEventStream`, `ReportEventStream`, `ListViewEventStream`) published on the event bus, plus storable events (`LoginEvent`, `ReportEvent`) kept in big objects.

For integrations, log fields identify the user, client IP, connected app, API version, rows processed and run time. That lets you spot an integration user that suddenly pulls a million rows or logs in from a new IP.

**Advanced / deep dive:** Transaction Security Policies act on real-time events. A policy can block or require MFA when, for example, a report export exceeds a row count. Event Monitoring Analytics (a CRM Analytics app) gives ready-made dashboards. For long-term retention and correlation, ship the data to a SIEM (see the SIEM entry). Log data is metadata about activity, not record contents, so it supports attribution and forensics but does not recover deleted or changed data.

**Code / config example:**
```sql
SELECT Id, EventType, LogDate, LogFileLength, Interval
FROM EventLogFile
WHERE EventType = 'API' AND LogDate = LAST_N_DAYS:1
```

**Hidden gotchas & must-remember points:**
- ELF files are retained 30 days, and hourly files are kept for a shorter period. Export them if you need longer retention.
- ELF is batch data and arrives with a delay, so it is not a real-time alert source. Use real-time events for that.
- Access needs "View Event Log Files" (and "View Real-Time Event Monitoring Data" for streams) on the reading user.
- Cost and availability depend on the license, so check what your edition includes.
- The CSV columns differ per event type, and new columns get added over time. Parse by header name, not position.

**Best practice:** Use an integration user with no other privileges to pull logs on a schedule, and alert on baselines per connected app.

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