subnet( ) Query Function

Compute a subnet from a ipv4 field; by default emits a into a _subnet field.

Parameters

Name Type Required Default Description
bits number Yes Specifies the output field (defaults to _subnet.)
as string No _subnet Specifies the prefix bits to include in the subnet, e.g. 23.
field string Yes Specifies the input field.

field is the unnamed parameter.

Examples

compute subnet for ‘ipAddress’ using 23bit prefix; emit into subnet field

subnet(ipAddress, bits=23, as=subnet)