Splunk Search

query help with chart

surekhasplunk
Communicator

Hi,

I have a csv file with inputs like this :

Time,Device,Interface,Duration,Bits In/sec,Bits Out/sec,BW
3/22/2019 12:26,A-01,Ethernet1/1,322,0.00000255,0.00000247,10000000000
3/22/2019 12:31,A-01,Ethernet1/1,317,0.00000247,0.00000247,10000000000
3/22/2019 12:37,A-01,Ethernet1/1,319,0.00000242,0.0000025,10000000000
3/22/2019 12:42,A-01,Ethernet1/1,320,0.00000248,0.0000024,10000000000

Now i need to show it in a graph like the attached picture where i can show in
x-axis the bandwidth usage and
y-axis i need Device:Interface name
and the usage details should come in the graph as shown in the screenshot. Please help asap.

alt text

Tags (2)
0 Karma
1 Solution

renjith_nair
Legend

@surekhasplunk,

Try

"your current search"
|eval Interfaces=Device.":".Interface
|stats sum("Bits In/sec") as BitsIn,sum("Bits Out/sec") as BitsOut by Interfaces
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

... | eval bandwidthIn = Duration * 'Bits In/sec'
| eval bandwidthOut = Duration * 'Bits Out/sec'
| eval Device:Interface = Device . ":" . Interface
| stats sum(bandwidthIn) AS bandwidthIn sum(bandwidthOut) AS bandwidthOut BY Device:Interface
0 Karma

surekhasplunk
Communicator

Hi @woodcock,

Whats the logic behind multiplying Duration with 'Bits In/Sec' and if we are multiplying with duration then should we not divide it by BW value ? Please suggest.

0 Karma

woodcock
Esteemed Legend

You said you desired Bandwidth usage; that is how to calculate usage.

0 Karma

surekhasplunk
Communicator

Ok.. thanks much @woodcock

0 Karma

niketn
Legend

@surekhasplunk I am confused. You have the data with fields and you have the expected chart in Splunk. Don't you already have the query? Is it assistance required with some assignment? or do you want something on top of the chart that has been attached?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

renjith_nair
Legend

@surekhasplunk,

Try

"your current search"
|eval Interfaces=Device.":".Interface
|stats sum("Bits In/sec") as BitsIn,sum("Bits Out/sec") as BitsOut by Interfaces
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

surekhasplunk
Communicator

Thank you so much.

0 Karma
Get Updates on the Splunk Community!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...