ismap

This page explains how to use the ismap function in APL.

Use the ismap function in APL to check whether a value is of the dynamic type and represents a mapping (also known as a dictionary, associative array, property bag, or object). A mapping consists of key-value pairs where keys are strings and values can be of any type. This function is especially useful when working with semi-structured data, such as logs or telemetry traces, where fields might dynamically contain arrays, objects, or scalar values.

Use ismap to:

  • Filter records where a field is a map.
  • Validate input types in heterogeneous data.
  • Avoid runtime errors in downstream operations expecting map values.

Usage

Syntax

ismap(value)

Parameters

NameTypeDescription
valueanyThe value to check for being a map.

Returns

Returns true if the value is a mapping (dictionary), otherwise returns false.

Example

Use ismap to find log entries where a dynamic field contains structured key-value pairs, such as metadata attached to HTTP requests.

Query

['sample-http-logs']
| extend is_structured = ismap(dynamic({"a":1, "b":2}))

Run in Playground

Output

_timeis_structured
2025-06-06T08:00:00Ztrue
  • isimei: Checks whether a value is a valid International Mobile Equipment Identity (IMEI) number.
  • isreal: Checks whether a value is a real number.
  • 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