Enricher re-writes fields it should not be

Open
#403 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
go

Research direction

Start by tracing how the enricher handles GoFlow2 flow fields when producing JSON, focusing on the reported IP and MAC address fields: src_addr, dst_addr, src_mac, dst_mac, and next_hop. Compare the enricher output with GoFlow2's output for the same flow to locate where those values change. Done means all IP and MAC fields remain usable after enrichment; the issue does not name a test or source file, so first locate the enrichment and serialization entry points.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
When piping goflow data through enricher, fields containing IP or MAC addresses are no longer usable. Only happens with the enricher. Running only goflow2 shows correct IP and MAC addresses in output.

To Reproduce
Steps to reproduce the behavior:

  1. Run GoFlow2 with arguments 'goflow2-2.2.2-7-gfb53b55-linux-aarch64 -transport.file.sep= -format=bin -addr=0.0.0.0:8880 | enricher -db.asn ./config/GeoLite2-ASN.mmdb -db.country ./config/GeoLite2-Country.mmdb'
  2. Wait for flows to come in
  3. Observe that the JSON output has invalid data in src_addr, dst_addr, src_mac, dst_mac, next_hop, and any other field that contains an IP or MAC address.

Expected behavior
Fields with IP or MAC address are not modified by the enricher
Captures
If applicable, add output (JSON, protobuf), packet captures and device configuration.

{"type":4,"sequence_num":6874,"sampler_address":"CgEAAQ==","bytes":17367,"packets":15,"src_addr":"z/Hj4Q==","dst_addr":"S0hP6w==","etype":2048,"proto":6,"src_port":80,"dst_port":36552,"in_if":1,"out_if":11,"src_mac":251206042811623,"dst_mac":237876075896724,"tcp_flags":16,"src_as":7941,"dst_as":7922,"next_hop":"AAAAAA==","src_country":"US","dst_country":"US"}

GoFlow2:

  • Version: [GoFlow2 v2.2.2-7-gfb53b55 (2025-05-28T23:53:14-0500)]
  • Environment: [Compiled from source]
  • OS: [Arch Linux]

Additional context

running enricher with -loglevel=debug does not produce any logs (beyond the initial starting message from info loglevel)

Dominant language
Go
Stars
817
Forks
182
Avg merge
4h 18m
Merged PRs (30d)
6

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from netsampler/goflow2

All issues in netsampler/goflow2

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.