Skip to content

Conversation

@ruru0x
Copy link

@ruru0x ruru0x commented Jun 4, 2025

The builtin netflow exporter of mikrotik routers uses the fields

  • flowStartSysUpTime (22)
  • flowEndSysUpTime (21)
  • systemInitTimeMilliseconds (160)

to determine the flow start and end timestamps at millisecond precision by adding the relative values of flowStart and flowEnd to the system init time.

These fields are not yet considered by goflow2 and hence the timestamps were left at their default value that corresponds to the export time. This fix is a quick and dirty workaround to address this problem.
Caution: The logic only works if the systemInitTimeMilliseconds field appears after the flowStartSysUpTime/flowEndSysUpTime in the set, which is the case for IPFIX packets originated from the Mikrotik netflow exporter. I'm not sure if this is a MUST, hence the caveat.

…nitTimeMilliseconds,flowStartSysUpTime,flowEndSysUpTime
@lspgn lspgn added the producer Conversion from flow to protobuf label Jun 7, 2025
@lspgn
Copy link
Member

lspgn commented Jun 7, 2025

@ruru0x thank you for your PR
This will require tests
Do you have a sample pcap?
My impression is this change introduce some edge cases based on the order of fields in the template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

producer Conversion from flow to protobuf

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants