isnull
This page explains how to use the isnull function in APL.
The isnull function evaluates its argument and returns true if the argument is null. Use this function to identify missing data, filter out incomplete records, or validate that optional fields are absent.
Usage
Syntax
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| value | scalar | Yes | The value to check for null. |
Returns
Returns true if the value is null, otherwise returns false. Note that empty strings return false because they're not null.
Use case examples
Identify HTTP requests with missing duration information to assess data quality and completeness.
Query
Output
| status | total_requests | missing_duration_count | missing_percentage |
|---|---|---|---|
| 500 | 1234 | 123 | 9.97 |
| 200 | 8765 | 87 | 0.99 |
| 404 | 2341 | 23 | 0.98 |
This query identifies the percentage of requests missing duration data by status code, helping assess logging infrastructure reliability and identify potential issues.
Find traces with missing duration information to identify instrumentation problems.
Query
Output
| service.name | kind | incomplete_spans |
|---|---|---|
| product-catalog | server | 234 |
| cart | internal | 123 |
| checkout | client | 89 |
This query identifies services with incomplete trace data, helping pinpoint instrumentation issues where duration information is not being captured properly.
Identify anonymous access attempts by finding requests without user identification.
Query
Output
| status | geo.country | total_failures | anonymous_failures | anonymous_rate |
|---|---|---|---|---|
| 401 | Unknown | 567 | 345 | 60.85 |
| 403 | Russia | 234 | 189 | 80.77 |
| 401 | China | 198 | 156 | 78.79 |
This query identifies patterns of anonymous failed access attempts by country, helping security teams detect automated attacks or scanning activity.
List of related functions
- isnotnull: Returns true if a value isn't null. Use this for the inverse check of isnull.
- isempty: Checks if a value is empty or null. Use this when you need to check for both null and empty strings.
- coalesce: Returns the first non-null value from a list. Use this to provide default values for null fields.
- gettype: Returns the type of a value. Use this to distinguish between null and other types.