Most FortiGate detections that “don’t work” in Microsoft Sentinel aren’t broken because of the KQL. They’re broken because the events they look for never arrive. Traffic logs fill CommonSecurityLog nicely, the dashboard looks busy, and meanwhile the VPN login failures, admin logins and configuration changes that the analytics rules actually need are filtered out somewhere between the firewall and the workspace.
I’ve rewritten this guide end to end. It now covers the forwarder build, the FortiGate CLI, how FortiGate fields land in Sentinel, and a validation pass you can run before you trust a single detection. One change matters more than the rest: Sentinel’s UEBA now builds behaviours and anomalies from FortiGate VPN and admin events (preview since August 2026), and those only work when the username field is populated. So “are my logs complete?” now decides whether UEBA works at all.
The path your logs take
FortiGate sends CEF over syslog to a Linux log forwarder. On the forwarder, rsyslog (or syslog-ng) listens on port 514 and hands each message to the Azure Monitor Agent (AMA). AMA versions 1.28.11 and later receive on local TCP port 28330. A data collection rule (DCR) tells the agent which syslog facilities and severities to keep, and the agent sends CEF messages to the CommonSecurityLog table.
| Hop | What can go wrong | How you’ll check it |
|---|---|---|
| FortiGate | Wrong format, wrong server, event categories switched off | diagnose sniffer on the FortiGate |
| Network | Port 514 blocked, wrong source interface | tcpdump on the forwarder |
| rsyslog | Not listening on 514, disk full | ss -lnp, systemctl status |
| AMA + DCR | Facility not in the DCR, DCR not associated | SECURITY_CEF_BLOB in the agent config cache |
| Sentinel | Fields in AdditionalExtensions, username empty | KQL checks below |
Each hop has its own check, and working through them in order is the quickest way I know to find where events disappear.
Before you start
- A Linux VM for the forwarder on a distribution AMA supports, with Python 3. If it isn’t an Azure VM, it needs the Azure Arc Connected Machine agent first, otherwise it won’t show up when you create the DCR.
- Microsoft Sentinel with the Common Event Format solution from the Content hub (it installs the Common Event Format (CEF) via AMA connector). The Fortinet FortiGate solution is worth installing too for its workbooks and analytics rules.
- Monitoring Contributor (to create the DCR) and Virtual Machine Contributor or Azure Connected Machine Resource Administrator (to deploy the agent).
- A network path from the FortiGate to the forwarder on TCP 514. If the forwarder sits in the cloud, plan for syslog over TLS instead of plain text across the internet.
Use the Defender portal. Microsoft has announced that after 31 March 2027 Sentinel is only available in the Microsoft Defender portal. The connector steps below are the same in both; in Defender you’ll find them under Microsoft Sentinel > Configuration > Data connectors.
Step 1: build the forwarder
Open the Common Event Format (CEF) via AMA connector page, select Create data collection rule, pick the forwarder VM under Resources and choose the facilities on the Collect tab. FortiGate sends on local7 unless you change it, so that facility must be in the DCR at LOG_INFO or lower; Microsoft’s own Fortinet example assumes local4, which is how a perfectly working FortiGate ends up sending into nothing. Pick one facility, write it down, and use the same value on both ends.
Then run Microsoft’s installer on the forwarder. It configures rsyslog or syslog-ng to listen on UDP and TCP 514 and restarts the daemon:
sudo wget -O Forwarder_AMA_installer.py https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/Syslog/Forwarder_AMA_installer.py && sudo python3 Forwarder_AMA_installer.py
Two things I’d do straight after. First, stop rsyslog from also writing every firewall message to /var/log, because a full disk stops the agent and FortiGate traffic logs fill a disk quickly. Second, if the same forwarder also has a Syslog via AMA DCR, don’t use the FortiGate facility in it, or every event lands in both Syslog and CommonSecurityLog and you pay twice.
Step 2: point the FortiGate at the forwarder
These commands are for FortiOS 7.x. mode reliable sends over TCP (RFC 6587), which is what Microsoft’s Fortinet instructions ask for. The first version of this guide used mode udp; UDP works, but messages lost on a busy link are gone without a trace, so I’d use TCP.
config log syslogd setting
set status enable
set server "10.10.20.15"
set mode reliable
set port 514
set format cef
set facility local7
end
If the forwarder is reachable through a tunnel or a dedicated management interface, add set source-ip or set interface-select-method specify with set interface, otherwise the FortiGate may source the traffic from an interface your firewall rules don’t expect. To send a second copy elsewhere, use config log syslogd2 setting rather than changing the first one.
Step 3: make sure the events you need are generated
This is the step most setups skip. The syslog setting only forwards what the FortiGate logs in the first place, and three separate places decide that.
Event categories
config log eventfilter
set event enable
set system enable
set vpn enable
set user enable
set router enable
end
system covers admin logins and configuration changes, vpn covers SSL VPN and IPsec, and user covers firewall authentication (FSSO, captive portal, RADIUS and LDAP results). They’re all enabled by default, but they’re also the first thing someone switches off when trying to cut log volume, so check rather than assume.
The syslog filter
config log syslogd filter
set severity information
set forward-traffic enable
set local-traffic enable
set anomaly enable
end
severity is the floor. Raise it to warning and you lose successful VPN and admin logins, which are exactly what UEBA uses to build a baseline. If someone added config free-style entries under this filter, read them carefully, because an include filter quietly drops everything that doesn’t match.
Traffic logging
Traffic logs come from each firewall policy (set logtraffic all or utm) and, for traffic to the FortiGate itself, from config log setting (local-in-allow, local-in-deny-unicast and related options). Logging denied local-in traffic is what shows you scanning of the admin and VPN ports. Forward traffic logging on every policy is usually the biggest cost in CommonSecurityLog, so decide per policy rather than turning everything on.
SSL VPN users: check your FortiOS version. From FortiOS 7.6.3, SSL VPN tunnel mode is removed and Fortinet recommends moving to IPsec VPN; web mode remains as “Agentless VPN” on supported models only, and models with 2 GB of RAM or less have no SSL VPN at all. If you’ve migrated, rules built only on SSL VPN log IDs (for example 39426, SSL VPN login fail) go quiet without any error. Re-test your VPN detections against the IPsec events your FortiGate produces now.
Step 4: generate test events
Don’t wait for real attacks to find out whether the pipeline works. Create events you can recognise, note the time, and look for them in each hop.
- A failed admin login on the GUI or SSH with a made-up username such as
sentinel-test-admin. This is log ID 32002, “Admin login failed”, type event, subtype system. - A successful admin login and a harmless configuration change, for example editing the comment on an address object.
- A failed VPN login with a made-up username, then a successful one with a real test account.
- A firewall authentication (if you use it), so the
usercategory has something to send.
On the FortiGate, diagnose log test also writes a set of sample logs of each type, which is handy for checking that every category is forwarded.
Step 5: validate hop by hop
On the FortiGate
show log syslogd setting
show log syslogd filter
diagnose sniffer packet any 'port 514' 4 10
The sniffer should show packets leaving towards the forwarder’s IP within seconds of a test event. Nothing here means the problem is on the FortiGate (filter, event category or routing), not in Azure.
On the forwarder
sudo systemctl status azuremonitoragent rsyslog
sudo ss -lnp | grep -E "28330|514"
sudo tcpdump -i any port 514 or port 28330 -A -c 20
sudo grep -i -r "SECURITY_CEF_BLOB" /etc/opt/microsoft/azuremonitoragent/config-cache/configchunks
You want rsyslog listening on 514 (TCP and UDP), the agent’s mdsd process on 28330, CEF text visible in the capture with CEF:0|Fortinet|Fortigate| near the start, and a JSON chunk from the grep. An empty grep means the DCR isn’t associated with this machine yet. If you get stuck, Microsoft’s troubleshooter collects most of this in one go and writes it to /tmp/troubleshooter_output_file.log:
sudo wget -O Sentinel_AMA_troubleshoot.py https://raw.githubusercontent.com/Azure/Azure-Sentinel/master/DataConnectors/Syslog/Sentinel_AMA_troubleshoot.py && sudo python3 Sentinel_AMA_troubleshoot.py --cef
In Sentinel
It helps to know how FortiGate fills the CEF header first. DeviceVendor is Fortinet and DeviceProduct is Fortigate. DeviceEventClassID holds the last five digits of the log ID (so 32002, not 0100032002). Activity holds type:subtype plus the action or status, and DeviceEventCategory holds type:subtype, for example event:vpn. FortiGate fields with no standard CEF name arrive in AdditionalExtensions with an FTNTFGT prefix. Allow up to 20 minutes for the first events to show up.
First, is anything arriving, and from which firewalls?
CommonSecurityLog
| where TimeGenerated > ago(1h)
| where DeviceVendor == "Fortinet" and DeviceProduct startswith "Fortigate"
| summarize Events = count(), LastSeen = max(TimeGenerated) by Computer, DeviceName, DeviceVersion
Then see what each FortiGate is really sending, by log description. This is the quickest way to spot a category that’s missing entirely, and to find the exact log IDs your own firmware uses for VPN and admin events:
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where DeviceVendor == "Fortinet"
| extend LogDesc = extract(@"FTNTFGTlogdesc=([^;]+)", 1, AdditionalExtensions)
| summarize Events = count() by DeviceEventCategory, DeviceEventClassID, LogDesc
| order by Events desc
Next, are all the categories there? This is the check I’d keep, because it shows a missing category as a row instead of as nothing:
let expected = datatable(Category:string) ["event:system", "event:vpn", "event:user", "traffic:forward", "traffic:local"];
let seen = CommonSecurityLog
| where TimeGenerated > ago(24h)
| where DeviceVendor == "Fortinet"
| summarize Events = count(), LastSeen = max(TimeGenerated) by Category = DeviceEventCategory;
expected
| join kind=leftouter seen on Category
| project Category, Events = coalesce(Events, long(0)), LastSeen,
Status = iff(isempty(LastSeen), "MISSING", "OK")
Did your test events arrive with the details you’ll need?
CommonSecurityLog
| where TimeGenerated > ago(2h)
| where DeviceVendor == "Fortinet"
| where DeviceEventClassID in ("32002", "39426")
or AdditionalExtensions has "sentinel-test-admin"
| extend LogDesc = extract(@"FTNTFGTlogdesc=([^;]+)", 1, AdditionalExtensions)
| project TimeGenerated, DeviceName, DeviceEventClassID, Activity, LogDesc,
SourceIP, SourceUserName, DestinationUserName, AdditionalExtensions
Is the username populated? UEBA and most identity-based rules depend on it:
CommonSecurityLog
| where TimeGenerated > ago(24h)
| where DeviceVendor == "Fortinet"
| where DeviceEventCategory in ("event:vpn", "event:user", "event:system")
| extend User = coalesce(SourceUserName, DestinationUserName,
extract(@"FTNTFGTuser=([^;]+)", 1, AdditionalExtensions))
| summarize Total = count(), WithUser = countif(isnotempty(User)) by DeviceEventCategory
| extend PercentWithUser = round(100.0 * WithUser / Total, 1)
If the user only appears in AdditionalExtensions, your rules need the extract() above (or a parser function), and UEBA won’t see it, because it reads SourceUserName.
And what does it cost? Run this once a week for the first month:
CommonSecurityLog
| where TimeGenerated > ago(7d)
| where DeviceVendor == "Fortinet"
| summarize GB = round(sum(_BilledSize) / 1e9, 2) by DeviceEventCategory
| order by GB desc
If traffic:forward dominates, that’s the place to cut, usually by logging only denied traffic on noisy internal policies. Avoid cutting event logs to save money; they’re small and they carry the detections.
Common problems and what they usually mean
| Symptom | Likely cause | Fix |
|---|---|---|
Nothing in CommonSecurityLog, packets visible in tcpdump | Facility not in the DCR, or DCR not associated | Add the FortiGate facility at LOG_INFO; check the SECURITY_CEF_BLOB grep |
FortiGate events in the Syslog table too | Same facility in a Syslog DCR | Remove the facility from the Syslog DCR, or add a transformation that drops CEF |
Traffic logs arrive, no event:vpn or event:system | eventfilter category disabled, or a free-style include filter | Re-enable the category; review config log syslogd filter |
| VPN detections went quiet after an upgrade | SSL VPN tunnel mode removed (7.6.3+), users now on IPsec | Rebuild VPN rules on the IPsec events you now see |
| Brute-force rule fires on IPsec noise | Rule matches every event:vpn failure, including IKE negotiation errors | Filter on the login-failure log IDs and require a username |
SourceUserName empty | User only in AdditionalExtensions, or authentication events not forwarded | Use extract() or a parser; confirm user and vpn categories are enabled |
| Event times look hours off | Forwarder and FortiGate in different time zones (EventTime versus TimeGenerated) | Use TimeGenerated for rules; keep the forwarder clock and zone correct |
| Forwarder stops sending | Disk full from local log files | Stop rsyslog writing firewall logs to disk; monitor disk usage |
Validation checklist before you trust the data
- The category check returns OK for
event:system,event:vpnandevent:useron every FortiGate, not just one. - Your test admin login failure (32002) and VPN login failure arrived with source IP and username.
- A configuration change shows up with the admin’s name and what was changed.
SourceUserNameis populated for most VPN and user events.- No FortiGate events are duplicated in the
Syslogtable. - An analytics rule or workbook alert fires when a FortiGate stops sending for 30 minutes, so a silent pipeline gets noticed.
- You’ve recorded the daily volume by category, so you can see a filter change or a misbehaving policy straight away.
For that last-but-one item, this query is a simple starting point for a scheduled rule:
CommonSecurityLog
| where TimeGenerated > ago(1d)
| where DeviceVendor == "Fortinet"
| summarize LastSeen = max(TimeGenerated) by DeviceName
| where LastSeen < ago(30m)
References
- Microsoft Learn: Ingest syslog and CEF messages to Microsoft Sentinel with the Azure Monitor Agent
- Microsoft Learn: Syslog and CEF via AMA connectors (architecture, duplication avoidance)
- Microsoft Learn: Troubleshoot CEF and Syslog via AMA connectors
- Microsoft Learn: CEF via AMA, device-specific instructions (Fortinet)
- Microsoft Learn: UEBA data sources (Fortinet in CommonSecurityLog)
- Fortinet: config log syslogd setting (FortiOS 7.6)
- Fortinet: config log eventfilter and config log syslogd filter
- Fortinet: FortiOS to CEF log field mapping guidelines
- Fortinet log reference: 32002 Admin login failed and 39426 SSL VPN login fail
- Fortinet Community: Changes on SSL VPN modes starting from v7.6.3
Updated 4 December 2026 (first published 28 November 2026). Facts checked against Microsoft Learn and Fortinet documentation as of 4 December 2026. CLI option names can differ between FortiOS releases, so confirm with ? in the CLI on your own version.



