Splunk Search

Search based on two different dropdowns

martin61
Engager

I have two dropdowns.  I only want to run a single dropdown everytime for a search.

Closed Dropdown has token value as field1

OPEN Dropdown has token value as field4

In the dashboard's source, I have listed below query, so that the panel picks up the data as per input provided in dropdowm

index=*|lookup bar.csv IP OUTPUT BAR BAR_Status |search BAR="$field1$" OR BAR="$field4$"|chart count(IP) by BAR,STATUS

So If select closed dropdown the chart should provide the details only related to Closed and vice-versa. Please help.

Tags (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Reads like what you need is "AND" not "OR".  You want to give each dropdown token a default  value of "*", then use

index=*|lookup bar.csv IP OUTPUT BAR BAR_Status |search BAR="$field1$" AND BAR="$field4$"|chart count(IP) by BAR,STATUS

This way, the unselected dropdown will always result in a true condition. (You may also want to see if there is a different workflow for the dashboard to avoid two dropdowns for the same field.  Additionally, you want to give input tokens descriptive names.)

0 Karma
Get Updates on the Splunk Community!

New Year, New Changes for Splunk Certifications

As we embrace a new year, we’re making a small but important update to the Splunk Certification ...

[Puzzles] Solve, Learn, Repeat: Unmerging HTML Tables

[Puzzles] Solve, Learn, Repeat: Unmerging HTML TablesFor a previous puzzle, I needed some sample data, and ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...