Extracts the field from a Record as an Option.
Extracts the field from a Record as an Option.
The value referenced from the record or None.
The path to the field to extract.
Extracts the specified field from a Record or a Sub-Record and casts the field to a type.
A simple string returns the named IE in the top-level record:
val protoEx = DeepFieldExtractor[Short]("protocolIdentifier") val proto = protoEx.extractFrom(r.get) proto: Option[Short] = Some(6)
One or more template names may preceed the named IE. Separate the sequence of template names and the IE by
DeepFieldExtractor$.delim.val initialTcpEx = DeepFieldExtractor[Short]("yaf_tcp_rev/initialTCPFlags") val initialTcp = initialTcpEx.extractFrom(r.get) initialTcp: Option[Short] = Some(2)
Prepend the
DeepFieldExtractor$.deepPrefixto either a lone IE name or a template name and IE sequence to start searching for the path at any depth within the Record.val unionTcpEx = DeepFieldExtractor[Short]("* /unionTCPFlags") val unionTcp = unionTcpEx.extractFrom(r.get) unionTcp: Option[Short] = Some(28)
To get a BasicList containing a specific IE from a Record, wrap the IE's name
ieNameas "basicList[ieName]" (seeDeepFieldExtractor$.wrapAsBasicList). For these, the type parameter T should always beBasicList.val agentEx = DeepFieldExtractor[BasicList]("* /basicList[httpUserAgent]") val agent = agentEx.extractFrom(r.get) agent: Option[org.cert.netsa.io.ipfix.BasicList] = Some((BL ...))
Use the BasicList's
elementsmethod to get the contents of the BasicList:val v = Vector.empty[String] ++ agent.get.elements
Maintains a mapping from Template to field position to improve performance when extracting a field from multiple Records that share the same Template.
The type to cast the field to.
SimpleFieldExtractor for a simplified version