Log processing functions - Network
DSLICE
DSLICE(domain, level)
Returns substring of domain containing labels up to the level specified.
Returns NULL if argument evaluates to NULL.
output type
STRING
Example:
FIELDS_ADD(DSLICE('www.dynatrace.com',2));
dslice |
---|
dynatrace.com |
IP_TRUNC
IP_TRUNC(ip_addr, prefix_len)
Returns an IPADDR
where first prefix_len bits are equal to those in ip_addr and the remaining are set to 0.
Returns NULL if argument evaluates to NULL.
output type
IPADDR
Example: retain first 24-bits of an IPv4 address
FIELDS_ADD(ipv4:IPADDR("192.168.100.100"), ipv6:IPADDR("2a00:1450:4010:c05::69"))
| FIELDS_ADD(ipv4_trunc:IP_TRUNC(ipv4, 24), ipv6_trunc:IP_TRUNC(ipv6, 24))
ipv4 | ip4_trunc | ipv6 | ip6_trunc |
---|---|---|---|
192.168.100.100 | 192.168.100.0 | 2a00:1450:4010:c05::69 | 2a00:1400::0 |
IP_TRUNC(ip_addr, ipv4_prefix_len, ipv6_prefix_len)
Returns an IPADDR
where first prefix_len bits are equal to those in ip_addr and the remaining are set to 0. Allows to specify different
prefix lengths for IPv4 and IPv6 type addresses (ipv4_prefix_len and ipv6_prefix_len respectively).
Returns NULL if argument evaluates to NULL.
output type
IPADDR
Example: retain first 24-bits of an IPv4 address
FIELDS_ADD(ipv4:IPADDR("192.168.100.100"), ipv6:IPADDR("2a00:1450:4010:c05::69"))
| FIELDS_ADD(ipv4_trunc:IP_TRUNC(ipv4, 24,96), ipv6_trunc:IP_TRUNC(ipv6, 24,96))
ipv4 | ip4_trunc | ipv6 | ip6_trunc |
---|---|---|---|
192.168.100.100 | 192.168.100.0 | 2a00:1450:4010:c05::69 | 2a00:1450:4010:c05::0 |
IS_IPV4
IS_IPV4(ip_expr)
Returns true if IPADDR
contains IPv4 address, otherwise returns false.
Returns NULL if argument evaluates to NULL.
output type
BOOLEAN
Example:
FIELDS_ADD(IS_IPV4(200.100.32.45:99));
is_ipv4 |
---|
true |
IS_IPV6
IS_IPV6(ip_expr)
Returns true if IPADDR
contains IPv6 address, otherwise returns false.
Returns NULL if argument evaluates to NULL.
output type
BOOLEAN
Example:
FIELDS_ADD(IS_IPV6(IPADDR('2a00:1450:4010:c05::69')));
is_ipv6 |
---|
true |
PARSEURI
PARSEURI(uri_str)
Returns array of URI elements parsed from STRING
type argument.
Returns NULL if argument evaluates to NULL.
output type
TUPLE
Example:
FIELDS_ADD(PARSEURI("https://docs.dynatrace.com:443/pages/dynatrace.html#sx-install"));
parseuri |
---|
{scheme="https" user=NULL host="docs.dynatrace.com" port=443 path="/pages/dynatrace.html" query=NULL fragment="sx-install"} |