Splunk Search

Search for multiple strings and put into one line chart.

mdavis43
Path Finder

I have a search that currently has 3 search terms...

host="s2a*" "Command Aborted" OR "Internal queue full" OR "Aborting CMD"

I want to put this into a line chart by number of occurrences returned. One line per search term. Can someone point me in the right direction?

Thanks

Tags (2)
0 Karma
1 Solution

yannK
Splunk Employee
Splunk Employee

as per answer from Kristian, here is a regex way to do it (considering that an event has only one of those strings).

host="s2a*" "Command Aborted" OR "Internal queue full" OR "Aborting CMD" | rex "(?< myfabulousfield >(Command Aborted|Internal queue full|Aborting CMD))" | stats count by myfabulousfield

View solution in original post

yannK
Splunk Employee
Splunk Employee

as per answer from Kristian, here is a regex way to do it (considering that an event has only one of those strings).

host="s2a*" "Command Aborted" OR "Internal queue full" OR "Aborting CMD" | rex "(?< myfabulousfield >(Command Aborted|Internal queue full|Aborting CMD))" | stats count by myfabulousfield

qtorque95
Explorer

in the "rex" you meant "regex", right? If "regex" what will be the proper Splunk statement to run your suggested answer? Thanks.

0 Karma

mdavis43
Path Finder

Thanks, that worked just fine. I replaced stats with timechart and it gave me the results I was looking for.

0 Karma

kristian_kolb
Ultra Champion

You need to extract the strings above into a field, e.g. my_field

then you run your search like;

... | timechart c by my_field

Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...