• Home
  • How to use Dynatrace
  • Log Monitoring
  • Log ingest & process
  • Log processing
  • Log processing functions
  • Log processing functions - Network

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:

plaintext
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

plaintext
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))
ipv4ip4_truncipv6ip6_trunc
192.168.100.100192.168.100.02a00:1450:4010:c05::692a00: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

plaintext
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))
ipv4ip4_truncipv6ip6_trunc
192.168.100.100192.168.100.02a00:1450:4010:c05::692a00: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:

plaintext
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:

plaintext
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:

plaintext
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"}