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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...