Dashboards & Visualizations

How can I reference searches across Prebuilt Panels

markbarber21
Path Finder

I want to use common panels across many dashboards. This way I can modify one object, and update all related dashboards. This is an important software principle of Don't Repeat Yourself.

I know you can create a report and reference the same report in multiple prebuilt and inlined panels, but reports do not offer tokenized values.

Is there was a way to use a prebuilt panel that has a search, and reference its search by ID in additional panels?

0 Karma

woodcock
Esteemed Legend

You can do it like this:

|rest/services/data/ui/panels
| search eai:appName="Your App Here" AND panel.title="Your Panel Title Here" AND title="Your title here"
| regex eai:data = "\<query\>"
| rex field=eai:data max_match=0 "\<query\>(?<query>.*?)\<\/query\>"
| eval query=mvindex(query, <some number here>)
| map search="search $query$"

adonio
Ultra Champion
0 Karma

markbarber21
Path Finder

I'm looking to have a panel with an inline search with an ID.
Save that panel as a Prebuilt Panel.

Use that panel in a dashboard, and have other Prebuilt or Inline panels reference the first search as a base search.

Looking to keep things DRY.

0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...