Telegraf measure traffic on specific port

Hi there!

I have a Telegraf container that I’m using to capture streaming network telemetry and would like to use Telegraf to monitor port 57000 for bytes received. How would I go about doing that?

Thanks!!

After some searching, I would suggest the iptables plugin: telegraf/plugins/inputs/iptables at master · influxdata/telegraf · GitHub

I haven’t done this so I can’t explain the details of how to do it, but from my brief reading, it looks like you can set an iptables rule (with a comment) for your port, and then the telegraf iptables plugin can monitor bytes associated with that rule.

If you get it working, please post a working example back. The community would benefit from this!

Will do!

image002.jpg

Hi, did you manage to do that?
I need to do the same but I couldn’t find any way to get port/socket granularity measurements also with other alternatives.
Thank you

Hello,
As per my knowledge,
To monitor port 57000 with Telegraf, add this to your telegraf.conf:

toml

Copy code

[[inputs.socket_listener]]
  service_address = "udp://:57000"
  data_format = "influx"


This config listens on port 57000 for incoming UDP traffic.
I hope this will help you ,
Thank you