Splunk Search

How to visualize all the search I put using the search command?

matcad81
New Member

HI All,

I would like to visualize all the search fields/content I mentioned using the command search:

index=* 

| search (Apps=value1 Or Apps=value2 OR Apps=value3)

| stats count by Apps

Apps count

value1

5
value2 0
value3 0

 

So, I want to see all the values I have mentioned in the search, even if they were not found (adding for example a 0 count)

Is it possible?

Thank you in advance.

Matteo

Labels (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

A typical way to show information that does NOT exist in Splunk is to include what you want to look for in a lookup and then do something like this

index=* [ | inputlookup my_list_of_apps.csv | fields Apps ]
| stats count by Apps
| append [
    | inputlookup my_list_of_apps.csv
    | fields Apps
    | eval count=0
]
| stats max(count) as count by Apps

which first searches for the apps in your lookup, then after that search is done, appends all the apps from the lookup with a count of 0 and then it "joins" them together and takes the max count. If there is no count originally, it will be 0

 

0 Karma

yuanliu
SplunkTrust
SplunkTrust

There are many ways to manipulate display.  One can be transpose.

| transpose header_field=Apps column_name=Apps
| foreach value1 value2 value3
    [eval <<FIELD>> = if(isnull(<<FIELD>>), 0, <<FIELD>>)]
| transpose header_field=Apps column_name=Apps

 

Tags (1)
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...