Splunk Search

How to write a search to find the count and group linkdown traps based on interface?

Velugs
Explorer

Dear All,

I am new to Splunk and got a request to create dashboard on Splunk. Criteria is to collect/group linkdown traps and need to have a count based on interface.

So example output needs to be like

Host --- Interface --- Count

Right now I am able to get Host --Count, but need to edit the search such that I get a count based on Interface and not host. Hope this is clear.

Kind Regards

0 Karma
1 Solution

renjith_nair
Legend

Try this :

<your search> |stats count,latest(Host) as Host by Interface

This can be modified to your final requirement

---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

renjith_nair
Legend

Try this :

<your search> |stats count,latest(Host) as Host by Interface

This can be modified to your final requirement

---
What goes around comes around. If it helps, hit it with Karma 🙂

Velugs
Explorer

Hey Thank you.. just want to update the forum .. I got it..

index=XXX sourcetype="YYY" "Server Interface Down" | rex "(?i) Interface Down on (?P[^ ]+)" | rex "on [^ ]+ - (?P[^\"]+)" | stats count,latest(Description) as Description by host,Interface | search count >=100 | sort - count 

Velugs
Explorer

Hi Thank you.. well using the below I get Interface--count--host any chance I modify the output such as I can see host--interface--count

0 Karma

Velugs
Explorer

Thanks for your time

it worked but with the below command

index=XXX sourcetype="YYY" "Server Interface Down" | head 10000  | rex "(?i) Interface Down on (?P[^ ]+)" | stats count,latest(host) as host by INTERFACE

Thank you Renjith 🙂

0 Karma

renjith_nair
Legend

Just replace latest(host) by values(host) to display all hosts in case there are multiple values

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...