Function
Arg | Description | Type |
---|---|---|
parse | Parse the IP as an IPv4 or IPv6 address. | string |
netaddr4_le | A network order IPv4 address (as little endian). | int64 |
netaddr4_be | A network order IPv4 address (as big endian). | int64 |
Format an IP address.
Converts an ip address encoded in various ways. If the IP address is encoded as 32 bit integer we can use netaddr4_le or netaddr4_be to print it in a human readable way.
This function wraps the Golang net.IP library (https://pkg.go.dev/net#IP ). This makes it easy to deal with various IP address notations. Some use cases:
SELECT ip(parse='0:0:0:0:0:FFFF:129.144.52.38') FROM scope()
Will return the string “129.144.52.38”
VQL will also expose the following attributes of the IP address:
IsGlobalUnicast
IsInterfaceLocalMulticast
IsLinkLocalMulticast
IsLinkLocalUnicast
IsLoopback
IsMulticast
IsPrivate
SELECT ip(parse='192.168.1.2').IsPrivate FROM scope()
Return “true” since this is a private address block.