cloudflare / goflow

The high-scalability sFlow/NetFlow/IPFIX collector used internally at Cloudflare.
BSD 3-Clause "New" or "Revised" License
852 stars 171 forks source link

Option to send Ip addresses fields as String instead of Base64 #91

Open Slepwin opened 3 years ago

Slepwin commented 3 years ago

Can you add some option to send fields with IP addresses as String instead of Base64.

jsirianni commented 3 years ago

I also had trouble with this. I think the best option is to just convert the Ip fields yourself.

quick example

var b  flowmessage.FlowMessage = {}
var ip net.IP = b
ipStr := ip.String()
lspgn commented 3 years ago

Just realized I missed this issue. The base format is protobuf. It is meant to be decoded programmatically and avoid conversion (performance impact). Changing the field from bytes to string would be a breaking change. I would invite you to check the JSON/text format which converts fields into their proper representation. Have a look at https://github.com/netsampler/goflow2 which has more control over outputs.