Getting Data In

How to calculate port utilization via SNMP for all ports of a host using the delta command?

JanOsterkamp
New Member

Hello Splunk Community,

I'm calculating the port Utilization with this search:

sourcetype=snmp host="xyz" InterfaceId=123456789 inOctets=* OR inMulticast=* OR inUcast=* OR inBroadcast=* OR InterfaceSpeed=*  
|sort _time 
|delta inBroadcast as deltaBroadcast 
|delta inOctets as deltaOctets 
|delta inMulticast as deltaMulticast 
|delta inUcast as deltaUnicast 
|delta _time as period |transaction _time 
|eval deltaPackets = deltaUnicast+deltaBroadcast+deltaMulticast 
|eval fl = deltaPackets*11 + (deltaOctets*8) 
|eval sl = 30*InterfaceSpeed*10000 
|eval Utilization = fl/sl 
|table InterfaceId del* InterfaceSpeed _time Utilization

Which works for one specific port. My problem is, that I'm not able to calculate the values for all ports of a host. Do you have any ideas?

Greets

0 Karma

maciep
Champion

it's kind of hard to help without seeing some sample data. But since delta works on adjacent events, just sort your data so that the ports are together, then sorted by time.

And then you'll need to put some logic in place to check for when the events change from one port to another. I typically use autoregress for that.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...

Customer success is front and center at .conf25

Hi Splunkers, If you are not able to be at .conf25 in person, you can still learn about all the latest news ...