Skip to content

to_string#

The to_string() function converts the provided argument to a string value.

Syntax#

to_string(value)

Parameters#

  • value: The value to convert to a string. This can be a boolean, integer, or IP address.

Return Value#

Returns a string representation of the provided value.

Example#

to_string(ip.src) // Converts the source IP to a string
to_string(http.response.code) // Converts the response code to a string

Use Cases#

  • Converting numeric values to strings for comparison or concatenation
  • Formatting IP addresses as strings for logging or header manipulation
  • Converting boolean values to strings for custom logic or reporting

Note#

This function is available only in template expressions and not in conditions.