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
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...