Dashboards & Visualizations

Dashboard Studio: How to create a input dropdown from datasource?

squared_away
Engager

Hello,

I have a number of unique searches for various infrastructure resources. I would like to create a dashboard that builds a chart based on the chosen entry from a dropown. Unfortunately, there's no easy way to create a base search and use tokens.

In other words, I would like each input title to reference a specific search in datsources.

example dropdown: 

input selected value 1= "dataSources": "search_1"

input selected value 2 = "dataSources": "search_2"

input selected value 3 = "dataSources": "search_3"

I could not find any documentation with examples of something similar.

Thanks in advance.

Labels (1)
Tags (2)
0 Karma
1 Solution

squared_away
Engager

I solved the challenge on my own.

I created multiple input items and used the search as the value. Then, I used the token from the input as the primary datasource.

Example

"input_1": {
"options": {
"items": [
{
"label": "Metric 1",
"value": "| mstats ***unique-search-string1******"
},
{
"label": "Metric 2",
"value": "| mstats ***unique-search-string2******"
},
{
"label": "Metric 3",
"value": "| mstats ***unique-search-string3******"
}
],
"defaultValue": "",
"token": "hosts_tok"
},
"dataSources": {
"primary": "$hosts_tok$"
},
"title": "Hosts",
"type": "input.dropdown"
}

If there's a better way please let me know.

View solution in original post

0 Karma

squared_away
Engager

I solved the challenge on my own.

I created multiple input items and used the search as the value. Then, I used the token from the input as the primary datasource.

Example

"input_1": {
"options": {
"items": [
{
"label": "Metric 1",
"value": "| mstats ***unique-search-string1******"
},
{
"label": "Metric 2",
"value": "| mstats ***unique-search-string2******"
},
{
"label": "Metric 3",
"value": "| mstats ***unique-search-string3******"
}
],
"defaultValue": "",
"token": "hosts_tok"
},
"dataSources": {
"primary": "$hosts_tok$"
},
"title": "Hosts",
"type": "input.dropdown"
}

If there's a better way please let me know.

0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

@squared_away - Kindly approve your own answer by clicking on the "Accept as Solution" button.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...