Converts a string to an IP address type.


Required Parameter
Expression that returns a string to be converted to an IP address. The argument type must be one of a string, int, or long.


When evaluating an expression, it works as follows:

  • When it is null, the expression returns null.
  • Even when it cannot be converted to an integer, the expression also returns null.
  • If any other type is passed as an argument, the expression converts it into a string and then attempts to convert it to an IP address.

IP addresses are one of the basic data types of Logpresso. The IP address starts with "/" and can represent both ipv4 and ipv6 addresses.


json "{}" | eval ip=ip("") => /

json "{}" | eval ip=ip("::1") => /0:0:0:0:0:0:0:1

json "{}" | eval ip=ip(4294967295) => /

json "{}" | eval ip=ip(-1062731775) => /

json "{}" | eval ip=ip("invalid") => null

json "{}" | eval ip=ip(null) => null