isint
isint is useful for data validation and type-checking in observability queries. For example, you can use it to verify that computed fields or imported values are whole numbers before performing integer-specific operations such as array indexing or factorial-based calculations.
Usage#
Syntax#
isint(expression)Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
expression |
real | Yes | The numeric value to check. |
Returns#
true if the value is a positive or negative integer (no fractional part). false for non-integer real numbers, NaN, and infinity.
Example#
Use isint to check whether a value is of integer type.
Query
print a = isint(42), b = isint(4.2)Output
| a | b |
|---|---|
| true | false |
List of related functions#
- isfinite: Returns
truefor values that are neither infinite nor NaN. Use it for a broader check covering all valid float states. - isinf: Returns
trueonly for infinite values. Use it to detect overflow results specifically. - isnan: Returns
trueonly for NaN values. Use it to detect undefined computation results. - round: Rounds a value to a given precision. Use it to produce integer-valued results before applying
isint. - sign: Returns the sign of a value. Use it alongside
isintwhen you need both the sign and the integer-status of a value.
Other query languages#
Splunk SPL users
Splunk SPL doesn't have a direct isint() function, but you can approximate the check by comparing a value to its floored counterpart.
Splunk example
| eval is_int = if(floor(value) == value, 1, 0)APL equivalent
['sample-http-logs']
| extend is_int = isint(value)ANSI SQL users
Standard SQL does not define an ISINT() function. You typically compare a value to its floored equivalent to determine whether it is a whole number.
SQL example
SELECT CASE WHEN FLOOR(value) = value THEN 1 ELSE 0 END AS is_int FROM logsAPL equivalent
['sample-http-logs']
| extend is_int = isint(value)