Try it free

DPL Numeric Data

  • Latest Dynatrace
  • Reference

Overview

This page documents the DPL matchers for numeric data. Matchers in the same family accept the same input but differ in output type or supported range—the tables below compare the related matchers side by side.

Integer matchers

Descriptioninput (string)INT (long)LONG (long)

Negative

-10

-10

-10

Decimal

2.5

2

2

Comma-separated

3,6

3

3

Hexadecimal

0xa01F

0

0

INT maximum

2147483647

2147483647

2147483647

INT maximum + 1

2147483648

null

2147483648

LONG maximum

9223372036854775807

null

9223372036854775807

LONG maximum + 1

9223372036854775808

null

null

Whitespace

␣

null

null

See how to use in DQL
data record(input = "-10"),
record(input = "2.5"),
record(input = "3,6"),
record(input = "0xa01F"),
record(input = "2147483647"),
record(input = "2147483648"),
record(input = "9223372036854775807"),
record(input = "9223372036854775808"),
record(input = " ")
| parse input, "INT:int"
| parse input, "LONG:long"

Hexadecimal matchers

Descriptioninput (string)HEXINT (long)HEXLONG (long)

Prefixed with 0x

0xa01F

40991

40991

Prefixed with x (no 0)

x3

3

3

Prefixed with -x (negative)

-xFE

-254

-254

Plain hex digits

10fE

4350

4350

Above INT range

0xFFFFFFFF

null

4294967295

LONG maximum

0x7FFFFFFFFFFFFFFF

null

9223372036854775807

LONG maximum + 1

0x8000000000000000

null

null

Non-hex text

word

null

null

Whitespace

␣

null

null

See how to use in DQL
data record(input = "0xa01F"),
record(input = "x3"),
record(input = "-xFE"),
record(input = "10fE"),
record(input = "0xFFFFFFFF"),
record(input = "0x7FFFFFFFFFFFFFFF"),
record(input = "0x8000000000000000"),
record(input = "word"),
record(input = " ")
| parse input, "HEXINT:hexint"
| parse input, "HEXLONG:hexlong"

BOOLEAN

Matches case-insensitive strings true and false.

Use the following pattern to parse boolean values:

BOOLEAN:result

For example, parsing boolean strings in different cases:

Descriptioninput (string)result (boolean)

Lowercase

true

true

Uppercase

FALSE

false

Mixed case

TrUe

true

Numeric, not a boolean

1

null

Word, not a boolean

yes

null

Whitespace

␣

null

See how to use in DQL
data record(input = "true"),
record(input = "FALSE"),
record(input = "TrUe"),
record(input = "1"),
record(input = "yes"),
record(input = " ")
| parse input, "BOOLEAN:result"

Returns

The data type of the extracted value is boolean.

Practical examples

Example 1: Parse boolean feature flag values

Given the following input:

debug_enabled=true

Use the following pattern to extract the boolean value:

'debug_enabled=' BOOLEAN:result
result (boolean)

true

See how to use in DQL
data record(input = "debug_enabled=true")
| parse input, "'debug_enabled=' BOOLEAN:result"
Example 2: Match a field that contains a valid boolean

Given the following input:

debug_enabled=maybe

Use the following pattern to check whether the field contains a valid boolean:

'debug_enabled=' BOOLEAN

We get the following output:

result (boolean)

false

See how to use in DQL
data record(input = "debug_enabled=maybe")
| fieldsAdd result = matchesPattern(input, "'debug_enabled=' BOOLEAN")

FLOAT

Matches floating point numbers in the form of [+|-]?[0-9]+[.0-9]* (dot "." separated) or [+|-]?[0-9]+[E|e0-9]* (scientific notation).

Use the following pattern to parse float values:

FLOAT:result

For example, parsing float values in different formats:

Descriptioninput (string)result (double)

Scientific notation

3e0

3.0

Integer

1

1.0

Dot-decimal value

0.1

0.1

Comma-decimal value

9,3

9.0

Whitespace

␣

null

See how to use in DQL
data record(input = "3e0"),
record(input = "1"),
record(input = "0.1"),
record(input = "9,3"),
record(input = " ")
| parse input, "FLOAT:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: FLOAT(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: -Double.MAX_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Double.MAX_VALUE.

Returns

The data type of the extracted value is double.

Basic example

Example: Match float values against a predefined range

The following pattern checks if a float value is between 1 and 3:

FLOAT(min=1, max=3)
Descriptioninput (string)result (boolean)

In range

2.5

true

At maximum

3.0

true

Below minimum

0.5

false

Above maximum

3.5

false

See how to use in DQL
data record(input = "2.5"),
record(input = "3.0"),
record(input = "0.5"),
record(input = "3.5")
| fieldsAdd result = matchesPattern(input, "FLOAT(min=1, max=3)")

Practical examples

Example 1: Parse the Mozilla and Firefox versions

Given the following input:

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Use the following pattern to extract the Mozilla and Firefox versions:

'Mozilla/' FLOAT:mozilla DATA 'Firefox/' FLOAT:firefox
mozilla (double)firefox (double)

5.0

123.0

See how to use in DQL
data record(input = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0")
| parse input, """'Mozilla/' FLOAT:mozilla DATA 'Firefox/' FLOAT:firefox"""
Example 2: Match Firefox version 148 or higher

Given the following input:

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0

Use the following pattern to check whether the Firefox version is 148 or higher:

LD 'Firefox/' FLOAT(min=148)

We get the following output:

result (boolean)

false

See how to use in DQL
data record(input = "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:123.0) Gecko/20100101 Firefox/123.0")
| fieldsAdd result = matchesPattern(input, """LD 'Firefox/' FLOAT(min=148)""")

CFLOAT

Same as FLOAT, but uses comma , as decimal separator: [+|-]?[0-9]+[,0-9]* or [+|-]?[0-9]+[E|e0-9]*.

Use the following pattern to parse comma-decimal float values:

CFLOAT:result

For example, parsing comma-decimal float values:

Descriptioninput (string)result (double)

Comma-decimal value

1,5

1.5

Dot-decimal value

1.5

1.0

Scientific notation

3e0

3.0

Integer

1

1.0

Whitespace

␣

null

See how to use in DQL
data record(input = "1,5"),
record(input = "1.5"),
record(input = "3e0"),
record(input = "1"),
record(input = " ")
| parse input, "CFLOAT:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: CFLOAT(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: -Double.MAX_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Double.MAX_VALUE.

Returns

The data type of the extracted value is double.

Basic example

Example: Match comma-decimal float values against a range

The following pattern checks if a comma-decimal value is between 1 and 5:

CFLOAT(min=1, max=5)
Descriptioninput (string)result (boolean)

In range

2,5

true

At maximum

5,0

true

Below minimum

0,5

false

Above maximum

6,0

false

See how to use in DQL
data record(input = "2,5"),
record(input = "5,0"),
record(input = "0,5"),
record(input = "6,0")
| fieldsAdd result = matchesPattern(input, "CFLOAT(min=1, max=5)")

DOUBLE

Matches floating point numbers in the form of [+|-]?[0-9]+[.0-9]* (dot "." separated) or [+|-]?[0-9]+[E|e0-9]* (scientific notation).

Use the following pattern to parse double values:

DOUBLE:result

For example, parsing double values in different formats:

Descriptioninput (string)result (double)

Scientific notation

3e0

3.0

Integer

1

1.0

Dot-decimal value

0.15

0.15

Comma-decimal value

0,15

0.0

Whitespace

␣

null

See how to use in DQL
data record(input = "3e0"),
record(input = "1"),
record(input = "0.15"),
record(input = "0,15"),
record(input = " ")
| parse input, "DOUBLE:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: DOUBLE(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: -Double.MAX_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Double.MAX_VALUE.

Returns

The data type of the extracted value is double.

Basic example

Example: Match double values against a predefined range

The following pattern checks if a double value is between 0 and 1:

DOUBLE(min=0, max=1)
Descriptioninput (string)result (boolean)

In range

0.15

true

At maximum

1.0

true

Above maximum

1.5

false

Whitespace

␣

false

See how to use in DQL
data record(input = "0.15"),
record(input = "1.0"),
record(input = "1.5"),
record(input = " ")
| fieldsAdd result = matchesPattern(input, "DOUBLE(min=0, max=1)")

Practical example

Example: Parse CPU and memory metric values

Given the following input:

metrics cpu.load=0.85 mem.used=2.5

Use the following pattern to extract the CPU load and memory usage:

LD 'cpu.load=' DOUBLE:cpu_load SPACE 'mem.used=' DOUBLE:mem_used
cpu_load (double)mem_used (double)

0.85

2.5

See how to use in DQL
data record(input = "metrics cpu.load=0.85 mem.used=2.5")
| parse input, "LD 'cpu.load=' DOUBLE:cpu_load SPACE 'mem.used=' DOUBLE:mem_used"

CDOUBLE

Same as DOUBLE, but uses comma , as decimal separator: [+|-]?[0-9]+[,0-9]* or [+|-]?[0-9]+[E|e0-9]*.

Use the following pattern to parse comma-decimal double values:

CDOUBLE:result

For example, parsing comma-decimal double values:

Descriptioninput (string)result (double)

Comma-decimal value

1,5

1.5

Dot-decimal value

1.5

1.0

Scientific notation

3e0

3.0

Integer

1

1.0

Whitespace

␣

null

See how to use in DQL
data record(input = "1,5"),
record(input = "1.5"),
record(input = "3e0"),
record(input = "1"),
record(input = " ")
| parse input, "CDOUBLE:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: CDOUBLE(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: -Double.MAX_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Double.MAX_VALUE.

Returns

The data type of the extracted value is double.

Basic example

Example: Match comma-decimal double values against a range

The following pattern checks if a comma-decimal value is between 0 and 2:

CDOUBLE(min=0, max=2)
Descriptioninput (string)result (boolean)

In range

1,5

true

At maximum

2,0

true

Above maximum

2,5

false

See how to use in DQL
data record(input = "1,5"),
record(input = "2,0"),
record(input = "2,5")
| fieldsAdd result = matchesPattern(input, "CDOUBLE(min=0, max=2)")

INT, INTEGER

Matches integral numbers in the form of [+|-]?[0-9]+ with values in the range -2147483648 to 2147483647. INTEGER is an alias for INT.

INT reads the leading run of digits and stops at the first non-digit character—for example, 2.5 yields 2. However, if that entire digit run forms a value outside the INT range, the result is null; it is not truncated to a shorter in-range prefix. For larger values, use LONG.

Use the following pattern to parse integer values:

INT:result

For example, parsing integer values including negative numbers:

Descriptioninput (string)result (long)

Negative

-10

-10

Decimal

2.5

2

Comma-separated

3,6

3

Hexadecimal

0xa01F

0

INT maximum

2147483647

2147483647

INT maximum + 1

2147483648

null

LONG maximum

9223372036854775807

null

LONG maximum + 1

9223372036854775808

null

Whitespace

␣

null

See how to use in DQL
data record(input = "-10"),
record(input = "2.5"),
record(input = "3,6"),
record(input = "0xa01F"),
record(input = "2147483647"),
record(input = "2147483648"),
record(input = "9223372036854775807"),
record(input = "9223372036854775808"),
record(input = " ")
| parse input, "INT:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: INT(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: Integer.MIN_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Integer.MAX_VALUE.

Returns

The data type of the extracted value is long.

Basic example

Example: Match integer values against a predefined range

The following pattern checks if an integer value is a valid HTTP 2xx status code:

INT(min=200, max=299)
Descriptioninput (string)result (boolean)

Success—in range

200

true

Success—in range

201

true

Client error—out of range

404

false

Server error—out of range

500

false

See how to use in DQL
data record(input = "200"),
record(input = "201"),
record(input = "404"),
record(input = "500")
| fieldsAdd result = matchesPattern(input, "INT(min=200, max=299)")

Practical example

Example: Parse an HTTP status code value

Given the following input:

GET /api/users HTTP/1.1 200 1234

Use the following pattern to extract the HTTP status code and response size:

LD 'HTTP/1.1 ' INT:status SPACE INT:bytes
status (long)bytes (long)

200

1234

See how to use in DQL
data record(input = "GET /api/users HTTP/1.1 200 1234")
| parse input, "LD 'HTTP/1.1 ' INT:status SPACE INT:bytes"

HEXINT

Matches integral numbers in hexadecimal notation [+|-]?0?x?[0-9a-fA-F]+ with values in the range -2147483648 to 2147483647.

HEXINT reads the leading run of hexadecimal digits and stops at the first character that is not a hex digit—for example, 10fEgh yields 4350. However, if that entire run forms a value outside the HEXINT range, the result is null; it is not truncated to a shorter in-range prefix. For larger values, use HEXLONG.

Use the following pattern to parse hexadecimal integer values:

HEXINT:result

For example, parsing hexadecimal values in different notations:

Descriptioninput (string)result (long)

Prefixed with 0x

0xa01F

40991

Prefixed with x (no 0)

x3

3

Prefixed with -x (negative)

-xFE

-254

Plain hex digits

10fE

4350

Above INT range

0xFFFFFFFF

null

LONG maximum

0x7FFFFFFFFFFFFFFF

null

LONG maximum + 1

0x8000000000000000

null

Non-hex text

word

null

Whitespace

␣

null

See how to use in DQL
data record(input = "0xa01F"),
record(input = "x3"),
record(input = "-xFE"),
record(input = "10fE"),
record(input = "0xFFFFFFFF"),
record(input = "0x7FFFFFFFFFFFFFFF"),
record(input = "0x8000000000000000"),
record(input = "word"),
record(input = " ")
| parse input, "HEXINT:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: HEXINT(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: Integer.MIN_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Integer.MAX_VALUE.

Returns

The data type of the extracted value is long.

Basic example

Example: Match hex integer values against a range

The following pattern checks if a hex value is within the 16-bit unsigned range:

HEXINT(min=0, max=65535)
Descriptioninput (string)result (boolean)

In range

0xa01F

true

In range

10fE

true

Negative—below minimum

-xFE

false

See how to use in DQL
data record(input = "0xa01F"),
record(input = "10fE"),
record(input = "-xFE")
| fieldsAdd result = matchesPattern(input, "HEXINT(min=0, max=65535)")

Practical example

Example: Parse a memory address value

Given the following input:

SIGSEGV at address 0x7ffd3a2c

Use the following pattern to extract the memory address:

'SIGSEGV at address ' HEXINT:address
address (long)

2147301932

See how to use in DQL
data record(input = "SIGSEGV at address 0x7ffd3a2c")
| parse input, "'SIGSEGV at address ' HEXINT:address"

LONG

Matches integral numbers in the form of [+|-]?[0-9]+ with values in the range -9223372036854775808 to 9223372036854775807.

LONG reads the leading run of digits and stops at the first non-digit character—for example, 2.5 yields 2. However, if that entire digit run forms a value outside the LONG range, the result is null; it is not truncated to a shorter in-range prefix.

Use the following pattern to parse long integer values:

LONG:result

For example, parsing long values including large numbers:

Descriptioninput (string)result (long)

Negative

-10

-10

Decimal

2.5

2

Comma-separated

3,6

3

Hexadecimal

0xa01F

0

INT maximum

2147483647

2147483647

INT maximum + 1

2147483648

2147483648

LONG maximum

9223372036854775807

9223372036854775807

LONG maximum + 1

9223372036854775808

null

Whitespace

␣

null

See how to use in DQL
data record(input = "-10"),
record(input = "2.5"),
record(input = "3,6"),
record(input = "0xa01F"),
record(input = "2147483647"),
record(input = "2147483648"),
record(input = "9223372036854775807"),
record(input = "9223372036854775808"),
record(input = " ")
| parse input, "LONG:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: LONG(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: Long.MIN_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Long.MAX_VALUE.

Returns

The data type of the extracted value is long.

Basic example

Example: Match long values against a predefined range

The following pattern checks if a long value is non-negative:

LONG(min=0)
Descriptioninput (string)result (boolean)

LONG maximum

9223372036854775807

true

Negative—below minimum

-2000

false

See how to use in DQL
data record(input = "9223372036854775807"),
record(input = "-2000")
| fieldsAdd result = matchesPattern(input, "LONG(min=0)")

Practical example

Example: Parse a Unix timestamp value in milliseconds

Given the following input:

event id=1576590440679 type=login

Use the following pattern to extract the event identifier:

'event id=' LONG:id SPACE LD
id (long)

1576590440679

See how to use in DQL
data record(input = "event id=1576590440679 type=login")
| parse input, "'event id=' LONG:id SPACE LD"

HEXLONG

Matches integral numbers in hexadecimal notation [+|-]?0?x?[0-9a-fA-F]+ with values in the range -9223372036854775808 to 9223372036854775807.

HEXLONG reads the leading run of hexadecimal digits and stops at the first character that is not a hex digit—for example, 10fEgh yields 4350. However, if that entire run forms a value outside the HEXLONG range, the result is null; it is not truncated to a shorter in-range prefix.

Use the following pattern to parse hexadecimal long values:

HEXLONG:result

For example, parsing hexadecimal long values in different notations:

Descriptioninput (string)result (long)

Prefixed with 0x

0xa01F

40991

Prefixed with x (no 0)

x3

3

Prefixed with -x (negative)

-xFE

-254

Plain hex digits

10fE

4350

Above INT range

0xFFFFFFFF

4294967295

LONG maximum

0x7FFFFFFFFFFFFFFF

9223372036854775807

LONG maximum + 1

0x8000000000000000

null

Non-hex text

word

null

Whitespace

␣

null

See how to use in DQL
data record(input = "0xa01F"),
record(input = "x3"),
record(input = "-xFE"),
record(input = "10fE"),
record(input = "0xFFFFFFFF"),
record(input = "0x7FFFFFFFFFFFFFFF"),
record(input = "0x8000000000000000"),
record(input = "word"),
record(input = " ")
| parse input, "HEXLONG:result"

Configuration

Specify configuration parameters in parentheses after the matcher name: HEXLONG(min=value, max=value):result.

ParameterTypeDescription

min

numeric

The minimum of parsed value. If the value is less than this the parsing fails and the output is set to null. Default: Long.MIN_VALUE.

max

numeric

The maximum of parsed value. If the value is greater than this the parsing fails and the output is set to null. Default: Long.MAX_VALUE.

Returns

The data type of the extracted value is long.

Basic example

Example: Match hex long values against a range

The following pattern checks if a hex long value is non-negative:

HEXLONG(min=0)
Descriptioninput (string)result (boolean)

Large positive value

0xFFFFFFFFFFFFFF

true

Small positive value

10fE

true

See how to use in DQL
data record(input = "0xFFFFFFFFFFFFFF"),
record(input = "10fE")
| fieldsAdd result = matchesPattern(input, "HEXLONG(min=0)")
Related tags
Dynatrace Platform