Dashboards & Visualizations

dashboard dropdown list by index

sarit_s
Communicator

hello
i have a dashboard with dropdown list which the search behind is :

index="emea_fdm" OR index="amer_fdm" |rex field=source \/splunk\/(?\w+) |dedup Region |table Region

i have security regulation that requires me to set rule to each user that he will be able to see data from specific index only. so for example, my user has role to see only emea_fdm index and data and not amer_fdm data.

im trying to set this dropdown list so each user will be able to see only the index relevant to him (i don't want to duplicate dashboards for each region)

the search has i pasted here gives me no results when im logging in with user who has rule to see index emea only

someone has any idea how can i achieve my goal ?

thanks

Tags (1)
0 Karma

niketn
Legend

@sarit_s even if you have multiple indexes mentioned in your Splunk query, user will be able to pull data only from the index that they have access to. So, your query should still work. However, from performance standpoint, since your query is based on index and source metadata fields you can use tstats instead.

| tstats count where index="*_fdm" by source
| rex field=source "\/splunk\/(?<Region>\w+)" 
| dedup Region 
| table Region

Or if the index names do not have pattern

| tstats count where index IN ("emea_fdm","amer_fdm") by source
| rex field=source "\/splunk\/(?<Region>\w+)" 
| dedup Region 
| table Region

PS: While posting code on Splunk Answers please use the code button one with 101010 icon or shortcut Ctrl+K, so that special characters do not escape.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

sarit_s
Communicator

this query does not return any results

i know that the query should still work but it isnt 🙂

0 Karma

sarit_s
Communicator

this is what im getting :

"Could not create search."

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

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

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...