Query Builder
In Data Explorer, the Query Builder interface allows you to build a query in modular steps using operators and filters. If your organization has access to the natural language query engine, the Query Builder is an alternative to the default natural language input.
A rule is a conditional statement that defines a dataset. A rule consists a Data Explorer field, an operator, and one or more values. A simple query has only one rule, whereas a complex query is a combination of two or more rules.
- You can combine two or more rules.
- You can use nested groups to define a set of rules and then combine multiple groups.
- You can combine rules and nested groups.
Simple operators
Simple operators allow you to create rules. A rule consists of a Data Explorer field, one or more values, and an operator that allows you to filter data.
| Operators | Description |
|---|---|
| = | Is equal to the single value that you specify. |
| != | Is not equal to the single value that you specify. |
| < | Is less than the single value that you specify. |
| <= | Is less than or equal to the single value that you specify. |
| > | Is greater than the single value that you specify. |
| >= | Is greater than or equal to the single value that you specify. |
| exists | Is not an empty Data Explorer field. |
| in | Is found in a set of values that you specify. |
| between | Is found within a specific and inclusive range. |
| not in | Is not found in a set of values that you specify. |
| contains | Contains the value that you specify. |
| starts with | Starts with the value that you specify. |
| not contains | Does not contain the value that you specify. |
| not exists | Is an empty Data Explorer field. |
| matches | Matches the regular expression that you specify. |
| not matches | Excludes values that match the expression that you specify. |
Complex operators
Complex operators allow you to combine rules.
| Operator | Description |
|---|---|
|
+ Rule |
Add a rule at the current level. |
|
+ Nested Group |
Add a subordinate group of rules. Rules in a nested group are evaluated separately from their parent query. The results are used for the parent query.
Note: A nested group with a single rule is the same thing as adding a single rule. It does not add a separate operator to the parent group. To use multiple operators, you must use multiple nested groups.
|
|
AND | OR |
Combine rules at the same level using the AND or OR Boolean operator, where:
|
Example query
This query can also be expressed as:
(user.name in <admin1>, <admin2> AND event.reason = event_reason) AND (file.path = <file_path> OR url.domain = <url>) AND event.severity >= 5
- Contain both:
- A
user.nameof either admin1 or admin2. - An
event.reasonof event_reason.
- A
- Contain either:
- A
file.pathof file_path. - A
url.domainof url.
- A
- Have an
event.severityvalue greater than or equal to 5.