Enrichment
GeoIP, user agent and community ID are the three runtime enrichers in crates/dfe-runtime/src/enrichment/, loaded once and shared across every transform. A generated transform calls one where its pipeline has a geoip, user_agent or community_id processor (parsers.md). The step they run in is Transform.
Each enricher reads one kind of field and writes one subtree back onto the same event.
Figure 1. L4 Detail -- Enrichers. Up: L4 Detail -- Transform.
GeoIP provisioning, storage, cache, output and failure:
- Provisioning: the config's
geoipsection is scalo'sGeoIpConfigas-is, because provisioning is shared across the fleet, and the lookup and its cache stay indfe-runtime. It defaults to enabled, with auto-download from DB-IP Lite, and is read once at startup. - Storage: the MMDB is memory-mapped through the
maxminddbcrate. - Cache: a bounded cache in front of the reader (
geoip_cache.rs), 100,000 entries by default. When full it evicts the oldest-stored quarter rather than tracking use, so a hit takes the read lock and updates nothing. A transform with severalgeoipprocessors hits the cache several times an event, counted ongeoip_cache_hits_totalandgeoip_cache_misses_total. - Output fields:
continent_name,country_name,country_iso_code,region_name,region_iso_code,city_name,location(lat,lon) andtimezone, plusasn,organization_nameandnetworkfrom an ASN database. - Failure: none reaches the event. A generated
geoipcall skips an absent field, and a value that is not an IP, a private address or a lookup miss writes no fields (geoip_global.rs).
The user agent parser matches pre-compiled regexes against the string and writes original, name, version, os.name, os.version, os.full, device.name and, where it can tell, device.type. Its output differs from Elastic's ua-parser in small ways.
Community ID is v1, a SHA-1 hash of the flow, read from source.ip, destination.ip, source.port, destination.port and network.transport or network.iana_number, with icmp.type and icmp.code for ICMP. It writes network.community_id, such as 1:LQU9qZlK+B5F3KDmev6m5PMibrg=.