Skip to content

Commit a56fefa

Browse files
authored
Merge pull request #3004 from SEKOIA-IO/feat/sol-null-checks-documentation
docs(sol): add null property checking documentation
2 parents e704b08 + 70860fb commit a56fefa

2 files changed

Lines changed: 113 additions & 0 deletions

File tree

docs/xdr/features/investigate/sol_how_to_guides.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,77 @@ SOL Datasets allow you to import CSV files and use them in your queries. This is
275275
For the full guide on importing CSVs, multi-tenancy rules, and advanced query patterns, see the dedicated [SOL Datasets](sol_datasets.md) page.
276276

277277

278+
## How to check for non-null properties
279+
280+
Many event fields are optional and may be absent from some records. Use `!= null` to keep only rows where a field is present, or `== null` to find rows where a field is missing.
281+
282+
### Filter out rows with a missing field
283+
284+
=== "Query"
285+
286+
```shell
287+
events
288+
| where timestamp > ago(24h) and user.name != null
289+
| select timestamp, host.name, user.name
290+
| order by timestamp desc
291+
| limit 100
292+
```
293+
294+
=== "Results"
295+
296+
| timestamp | host.name | user.name |
297+
| ------------------------ | ------------ | ------------ |
298+
| 2026-03-26T15:35:14.738Z | laptop-chris | ada_lovelace |
299+
| 2026-03-26T15:30:02.110Z | laptop-chris | grace_hopper |
300+
301+
### Find rows where a field is absent
302+
303+
Checking for `== null` is useful to detect incomplete or unparsed events:
304+
305+
=== "Query"
306+
307+
```shell
308+
events
309+
| where timestamp > ago(24h) and process.name != null and process.command_line == null
310+
| select timestamp, host.name, process.name
311+
| order by timestamp desc
312+
| limit 100
313+
```
314+
315+
=== "Results"
316+
317+
| timestamp | host.name | process.name |
318+
| ------------------------ | --------------- | ------------ |
319+
| 2026-03-26T14:20:15.441Z | laptop-6a1ec62f | svchost.exe |
320+
| 2026-03-26T14:17:31.554Z | laptop-b3205bc2 | lsass.exe |
321+
322+
### Combine multiple null checks
323+
324+
You can combine null checks with other conditions in the same `where` clause:
325+
326+
=== "Query"
327+
328+
```shell
329+
events
330+
| where timestamp >= ago(24h)
331+
and event.action == 'blocked'
332+
and user.name != null
333+
and url.domain != null
334+
| select timestamp, user.name, url.domain
335+
| order by timestamp desc
336+
| limit 100
337+
```
338+
339+
=== "Results"
340+
341+
| timestamp | user.name | url.domain |
342+
| ------------------------ | ------------ | --------------- |
343+
| 2026-03-26T15:35:14.738Z | ada_lovelace | www.example.com |
344+
| 2026-03-26T15:30:02.110Z | grace_hopper | www.test.org |
345+
346+
For the full reference, see [Where](sol_ref_operators.md#where).
347+
348+
278349
## How to build a query library
279350

280351
Build a collection of reusable queries to accelerate your team's investigations:

docs/xdr/features/investigate/sol_ref_operators.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,48 @@ Use the `where` operator to filter rows by a list of conditions. Use parenthesis
160160
| 2026-03-26T14:20:15.441Z | Android |
161161
| 2026-03-26T14:19:47.883Z | Mac |
162162
163+
### Checking for non-null properties
164+
165+
Many event fields are optional and may not be present in every event. Use `!= null` to keep only rows where a field has a value, or `== null` to find rows where the field is absent.
166+
167+
!!! example "Retrieve events where `user.name` is present"
168+
169+
=== "Query"
170+
171+
``` shell
172+
events
173+
| where timestamp > ago(24h) and user.name != null
174+
| select timestamp, host.name, user.name
175+
| limit 100
176+
177+
```
178+
179+
=== "Results"
180+
181+
| timestamp | host.name | user.name |
182+
| ------------------------ | ------------ | -------------- |
183+
| 2026-03-26T14:22:03.120Z | laptop-chris | ada_lovelace |
184+
| 2026-03-26T14:19:47.883Z | laptop-chris | grace_hopper |
185+
186+
!!! example "Find events where `process.command_line` is missing"
187+
188+
=== "Query"
189+
190+
``` shell
191+
events
192+
| where timestamp > ago(24h) and process.name != null and process.command_line == null
193+
| select timestamp, host.name, process.name
194+
| limit 100
195+
196+
```
197+
198+
=== "Results"
199+
200+
| timestamp | host.name | process.name |
201+
| ------------------------ | --------------- | ------------ |
202+
| 2026-03-26T14:20:15.441Z | laptop-6a1ec62f | svchost.exe |
203+
| 2026-03-26T14:17:31.554Z | laptop-b3205bc2 | lsass.exe |
204+
163205
## Nested query
164206
165207
Use the `in` operator to use the results of a previous query.

0 commit comments

Comments
 (0)