I'm creating a Dashboard in Splunk. It has one dropdown menu to select App-name(App1 or App2), another drop-down to select log_type (Detailed and App_specific), and a Search panel to show output of search query.
For instance,
- If user selects App1 and log_type as app_specific, then the Panel should result for the query:
index=App1 "taskExecutor-1" | sort -_time | table msg
For App1, selecting app_specific should add "taskExecutor-1" to the query.
- If user selects App2 and log_type as app_specific, then the Panel should result for the query:
index=App2 "ool-44-thread-1" | sort -_time | table msg
For App2, selecting app_specific should add "ool-44-thread-1" to the query.
-
- If user selects App1 and log_type as Detailed, then the Panel should result for the query:
index=App1 | sort -_time | table msg
Selecting Detailed should not anything to the query. Or we can say, an empty value.
How can I customize the query to accommodate such behavior in Splunk? Is there any any if/else or case functionality in Splunk that can help achieve this behavior?