Dashboards & Visualizations

Based on drop down list value how to change search string in each panel

Jasmine
Path Finder

Based on drop down list value how to change search string in each panel

eg 

for panel to load the search string will vary as below:

index=test (source="/test/log/path/test1.log" $param1$  c="$param2$" $dropdownlistvalue1$ $dropdownlistvalue1$)


As log path is different all my params vary. so how can i change index based of drop down list value?

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You might be able to use the change stanza for the input to set up multiple tokens based on the value selected. For example, your value in the drop down could have 3 parts delimited by some character, e.g. colon. The change stanza would then process the value and set 3 different tokens based on the 3 parts of the value.

0 Karma

Jasmine
Path Finder

can u pls.s give some sample. my requiremnt is i do have two differnt paths

index=test (source="/test/log/path/test1.log" )
index=test (source="/test/log/path/test2.log" )

based on dropdownlist value the above the path should be taken in Search string

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

What do you currently have in your dropdown?

0 Karma

Jasmine
Path Finder

eg. i have in drop down i have server and cloud. 

if i select Server - the path would be 

source="/test/log/path/server1.log"

 

if i select cloud the path would be vary for each region.

for TEST -  source="/test/log/path/testserver1.log"

for QA -   source="/test/log/path/qaserver1.log"

for PROD -   source="/test/log/path/prodserver1.log"

 

so i kept the first drop down list to select server and cloud. And then environment drop down lsit. and remaining panels load based on the server/cloud drop down list and env .drop down list

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Couldn't you just have one drop down?

EnvironmentLog source
Server/test/log/path/server1.log
TEST/test/log/path/testserver1.log
QA/test/log/path/qaserver1.log
PROD/test/log/path/prodserver1.log

 

0 Karma

Jasmine
Path Finder

i want to add  in source

index=test (source="/test/log/path/qaserver1.log")

without showing these path in dropdown list to user.. can we have some other method?.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The dropdown has two fields, the label and the value - it is the label that is shown to the user and the value which is put in the token

When you use the token in a search, the value can be found out by the user if they open the search in another window. There are ways to make this more difficult to find out but do you really need to go that far?

0 Karma

Jasmine
Path Finder

So we have to create two different drop down list for each path and show/hide can be used?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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