CESNET / ipfixcol

IPFIXcol is an implementation of an IPFIX (RFC 7011) collector
Other
64 stars 37 forks source link

How to add ODID as an additional field in json output #203

Closed ResearchIntern98 closed 6 years ago

ResearchIntern98 commented 6 years ago

It would be of great help if ODID is also written along with flows in json output.

thorgrin commented 6 years ago

This would require passing a pointer to the ipfix_msg->input_info structure to Storage::storeDataRecord method (https://github.com/CESNET/ipfixcol/blob/master/plugins/storage/json/Storage.cpp#L105), adding a configuration option for this feature and updating the Storage::storeDataRecord to add input_info->odid to the json message.

Optionally, we can add option for including source IP address and source port as well.

It seems quite easy, you can do it yourself and make a pull request or wait a bit till I find some time to implement it.

ResearchIntern98 commented 6 years ago

Thanks. I shall wait for it. :)

thorgrin commented 6 years ago

I've just commited the code to the devel branch. Just by adding <odid>yes</odid> to the configuration, you should be able to print the odid. Please let me know if there is a problem with the code, I've tested it only on a small sample. Thanks