Dashboards & Visualizations

Dashboard - Add prefix to all searches in panels

Narj
Path Finder

Hi all,

I was wondering if it's possible to automatically insert a prefix to the searches in a dashboard or form? I'd like to duplicate an existing "global" dashboard but insert a prefix like sourcetype="syslog" AND host="REGIONCODE*" before each search that's carried out in the view. This would be for a regional team who only need to see hosts with a a certain name prefix.

I've scoured the docs and there are hints of this being possible, however I'm using simplified XML forms (with timepickers) for my views at the moment.

If anyone has any working examples or pointers, I'd really appreciate it! 🙂

Thanks in advance!

Tags (1)
0 Karma
1 Solution

lguinn2
Legend

One way to do this would be to create a role for that particular team. Go to Manager » Access controls » Roles

When you create the role, add

sourcetype="syslog" AND host="REGIONCODE*"

to the Restrict search terms field.

This will prefix the sourcetype and host to all searches run by people who are assigned this role. So it will apply to all dashboards, etc. I think this is a better solution, as it means that you don't have two copies of the same dashboard.

But if you want to look at other solutions, you might consider downloading the app Splunk UI Examples for 4.1+ and seeing how they do post-processing.

View solution in original post

0 Karma

lguinn2
Legend

One way to do this would be to create a role for that particular team. Go to Manager » Access controls » Roles

When you create the role, add

sourcetype="syslog" AND host="REGIONCODE*"

to the Restrict search terms field.

This will prefix the sourcetype and host to all searches run by people who are assigned this role. So it will apply to all dashboards, etc. I think this is a better solution, as it means that you don't have two copies of the same dashboard.

But if you want to look at other solutions, you might consider downloading the app Splunk UI Examples for 4.1+ and seeing how they do post-processing.

0 Karma

Narj
Path Finder

Brilliant, that's just what I was looking for, thanks very much!

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...