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

Function Traits: FieldComputationFunction, Transformation

ParameterTypeRequiredDefaultDescription
asstringoptional_subnet Specifies the name of the output field.
bitsnumberrequired  Specifies the prefix bits to include in the subnet, e.g. 23.
field[a]stringrequired  Specifies the input field.

[a] The argument name field can be omitted.

The parameter name for field can be omitted; the following forms are equivalent:

logscale
subnet("value")

and:

logscale
subnet(field="value")

subnet() Examples

Compute subnet for ipAddress using 23bit prefix; emit into subnet field

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