KQL Queries: Fortinet


I am looking to extract from Fortinet log(s), any DNS events which are deemed high risk.


I have written this query BUT could do with some advice on how to improve it or identify other related queries, that shows those high-risk elements...


//List DNS entries with risk-related Log Severity
| where TimeGenerated > ago (6h)
| where DeviceVendor =~ "Fortinet"
| where ApplicationProtocol == "DNS"
| where LogSeverity has_any ("0","1","2","3")
| where isnotempty(SourceIP) and isnotempty(DestinationIP) and SourceIP != ""
| where DeviceAction !in ("close", "client-rst", "server-rst", "deny") and DestinationPort != 161
| project DeviceProduct, LogSeverity, DestinationPort, DestinationIP, Message, SourceIP, SourcePort, Activity, SentBytes, ReceivedBytes
| sort by LogSeverity


ANY help is appreciated...

4 Replies
best response confirmed by JMSHW0420 (Contributor)

Maybe look at ASIM,

1. Look at the ASIM parser for Fortigate, to get some of the Columns you may need in a normalized way (you may want to adopt the column naming to get your finished query aligned to ASIM now - that way if Forti release a parser you are probably virtually ready to use it). 


2. look at the other DNS ASIM parsers, whilst there isn't one for Forti (yet), you may get some ideas.



3. Also look at the DNS Queries that use ASIM Azure-Sentinel/Detections/ASimDNS at master · Azure/Azure-Sentinel (

Hi Clive,

Thank you for the rapid response.

Not really used ASIM parsers in anger. So assume this means deploying the related parser from the GitHub repository provided at:

Your first screen-shot is generated from where?


Many are now enabled by default - thanks to Microsoft.  Look in Sentinel --> Logs 



Most ASIM parsers are duplicated, one starts with _IM_   ,and the other style _ASim_    The difference is that the _IM_ version allows parameter to be passed (you can see which parameters when you hover over the name), you can also use the function or load the function code to see what its doing!



Hi Clive,

Sorry mate, I actually do know what you mean. Thanks for the clarification though. Much appreciated.