Splunk Search

How to create a single visualization using the results from multiple searches?

splunknewby
Path Finder

Currently I have four different visualizations (bar graphs) that are created using a data set. Each search I run filters for a specific set of conditions on that data, and a visualization is drawn after.

My problem is, once I generate the first graph, I would like to run a completely new search on the complete data (without using the filtered data of the last search), filter and generate my second graph and overlay this on top of the first graph.

How would I go about doing this?

I would like to overlay all four graphs on top of each other. If this isn't possible, then draw everything in a single graph without the overlaying.

The important bit is somehow storing the variables from the previous search so that I can use it at the end for a single graph.

0 Karma

emiller42
Motivator

Without any specifics, I can't really give you code. But it sounds like all of your graphs are coming from the same source set of data. So see what you can do to get to your final result set in a single search.

If you're filtering the data set, see if you can use those filters to simply identify matching records and categorize them appropriately:

sourcetype=my_sourcetype 
| eval category=case(searchmatch("some conditions"), "category_one", searchmatch("different conditions"), "category_two") 
| timechart count by category

This is just a general example. You can use many methods to generate fields which can be used to construct your final output.

Attempting the above accomplishes a couple of things for you:

  1. It gets your consolidated graph as you desire
  2. It gets your result in a single search pass instead of running multiple searches over the same data. Generally, this is a significant performance increase.
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!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...