set
Use the set operator to generate a table from two subsearches with a set operation applied to search results.
Syntax
|set <operation> <subsearch1> <subsearch2>
<operation>
|
Required. Specify the operation to be applied to search results. Possible options:
|
<subsearch1>
|
Required. Specify the first subsearch, using square brackets ( |
<subsearch2>
|
Required. Specify the second subsearch, using square brackets ( |
Usage
You can use the set operator to find differences or similarities between the result sets in a consolidated form.
Examples
Example 1: Find differences between production and staging event logs.
|set diff [eventlog | where sourcetype = 'prod' | fields src, dest, timestamp, bytes_in] [eventlog | where sourcetype = 'staging' | fields src, dest, timestamp, bytes_in]
Example 2: Find common entries between CrowdStrike and Netscope event logs.
|set intersect [eventlog | where sourcetype contains "crowdstrike" | fields src, dest] [eventlog | where sourcetype contains "netscope"| fields src, dest]