Overview

isreal

You often use isreal in data cleaning pipelines, conditional logic, and when inspecting metrics like durations, latencies, or numeric identifiers. It’s especially useful when working with telemetry or log data that includes optional or incomplete numeric fields.

Usage#

Syntax#

isreal(value)

Parameters#

Name Type Description
value any The input value to evaluate.

Returns#

Returns true if the input is a valid real number. Returns false for strings, nulls, or non-numeric types.

Example#

Use isreal to identify real number values.

Query

['sample-http-logs']
| extend is_real = isreal(123.11)

Run in Playground

Output

_time is_real
2025-06-05T12:01:00Z true
  • isimei: Checks whether a value is a valid International Mobile Equipment Identity (IMEI) number.
  • ismap: Checks whether a value is of the dynamic type and represents a mapping.
  • iscc: Checks whether a value is a valid credit card (CC) number.
  • isstring: Checks whether a value is a string. Use this for scalar string validation.
  • isutf8: Checks whether a value is a valid UTF-8 encoded sequence.

Other query languages#

Splunk SPL users

Splunk uses the isnum function to check whether a string represents a numeric value.

Splunk example

... | eval is_valid = if(isnum(duration), "yes", "no")

APL equivalent

... | extend is_valid = iff(isreal(duration), 'yes', 'no')
ANSI SQL users

ANSI SQL doesn’t have a direct equivalent to isreal. You typically check for numeric values using IS NOT NULL and avoid known invalid markers manually. APL’s isreal abstracts this by directly checking if a value is a real number.

SQL example

SELECT *,
       CASE WHEN duration IS NOT NULL THEN 'yes' ELSE 'no' END AS is_valid
FROM traces

APL equivalent

['otel-demo-traces']
| extend is_valid = iff(isreal(duration), 'yes', 'no')

Updated

Was this page helpful?