Closed jeremyforan closed 5 years ago
What is your flow data source? Could you look at the flow data in Wireshark to check what timestamps are in the flow data? If not, can you provide sample of the flow data (a pcap perhaps)?
We have been using this plugin quite a lot so I guess there is some misconfiguration or misinterpretation of the source data, such as microseconds being interpreted as milliseconds. Or maybe, in case of NetFlow v9, there may be a problem with the conversion to IPFIX. But we need a bit more information to find the cause.
I have the pcap open in wireshark, not sure how to hone in on the flowStartSeconds value. Is there a reference you can point me to?
Maybe this tutorial will help: https://helpdesk.kaseya.com/hc/en-gb/articles/115003522631-How-to-view-NetFlow-in-WireShark
You just need to find your NetFlow packet (using cflow in the filter field) and then open the payload. Any packet with data sets should have the timestamp if you open individual flows.
As fair as I can tell everything looks fine for the IPFIX data I am receiving.
tcpdump -i any "port 4739" -w /tmp/ipfix.pcap
screenshot
It seems that you are receiving the timestamps in dateTimeSeconds format. There was definitely a bug in the code handling this format. I've fixed it in devel branch. Could you rebuild the json plugin from devel and try it again? Unfortunately, I do not have any source which would send timestamps as seconds, so I cannot easily test it myself. If you need an rpm package, let me know, I can create one for your.
an RPM would be ideal.
Sent from my iPhone
On Nov 19, 2018, at 08:26, Petr Velan notifications@github.com wrote:
It seems that you are receiving the timestamps in dateTimeSeconds format. There was definitely a bug in the code handling this format. I've fixed it in devel branch. Could you rebuild the json plugin from devel and try it again? Unfortunately, I do not have any source which would send timestamps as seconds, so I cannot easily test it myself. If you need an rpm package, let me know, I can create one for your.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I've created a RPM for Centos 7 system. You just need to reinstall it locally. If everything is fine, I'll increase version and push it to the package mirror. json.zip
I am running AWS EC2 Linux 2, it didn't like the rpm https://aws.amazon.com/amazon-linux-2/
[root@tmp]# yum install ipfixcol-json-output-1.2.5-1.src.rpm
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Examining ipfixcol-json-output-1.2.5-1.src.rpm: ipfixcol-json-output-1.2.5-1.src
Cannot add package ipfixcol-json-output-1.2.5-1.src.rpm to transaction. Not a compatible architecture: src
Error: Nothing to do
Sorry, my mistake, I uploaded the source RPM instead of the compiled binary. Please try this one. json.zip
Its looking good!!!
[root@]# head -n1 json.201811191820 | python -mjson.tool
{
"@type": "ipfix.entry",
"flowEndSeconds": 1542651894,
"flowStartSeconds": 1542651882,
...
}
Good, thank you for reporting and testing this. I've just created new json plugin package in the COPR repository.
Does this mean it is now pushed out to the general repo's? what is the version?
group_CESNET-IPFIXcol/x86_64/primary_db | 30 kB 00:00:00
Resolving Dependencies
--> Running transaction check
---> Package ipfixcol-json-output.x86_64 0:1.2.5-1 will be updated
---> Package ipfixcol-json-output.x86_64 0:1.2.6-1 will be an update
--> Finished Dependency Resolution
Yes, version 1.2.6 is the one with the bugfix.
I am outputting using the json file writer and the timestamps cant possibly be correct