Technical Tip: How to write a regular expressions (regex) for DNS queries in event dropping rule
| Description | This article describes how to write a regex filter in the Event Dropping rule. |
| Scope | FortiSIEM. |
| Solution | To achieve the desired event dropping for specific queries based on the raw logs, it is necessary to configure as below:
(7)outlook(6)office(3)com(0)
Regex For Office: \(\d+\)outlook\(\d+\)office\(\d+\)com\(\d+\)
(16)onedscolprdeus11(6)eastus(8)cloudapp(5)azure(3)com(0)
Regex for Azure: \(\d+\)cloudapp\(\d+\)azure\(\d+\)com\(\d+\)
Regex for Microsoft: \(\d+\)teams\(\d+\)microsoft\(\d+\)com\(\d+\)
(?s)^(?!.*SensorGroupingTags.*ABC).* If this does not work, check it with the following:
(?s)^(?!.*"SensorGroupingTags".*ABC).* This regex filter is working as expected. It performed a lookup query and generated other events from the Windows DNS server.
The events did not appear in the real-time analytics, which aligns with expectations, since the relevant drop event has been enabled. |
