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!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...