Dashboards & Visualizations

How to use dynamic tokens for dbxquery?

aganguri
Observer

Hello Everyone,

I have a requirement in which I need to create a dashboard, which has separate panels for each sale category it is based up sale _type selected.  This chart should show up the time stamp and the time taken for the transaction call for that sale_category.

For that I need one static dropdown which lists the sale_type and second one which comes up with categories dynamically upon selection of sale item. also, each category should have a separate panel which shows up the time and the duration of each call made.

The table contains columns (Time_Stamp, Sale_type, Sale_Category, Min_value, Max_value, Mean_Value, count_calls)

example:
Sale_type => (Refreshments, Dinner, Lunch, Breakfast)

Sale_Category=>
Refreshments - (Juice / Milkshake / lassi)
Dinner - (Pasta, chicken wings)
Lunch - (Fried rice, Pizza)
Breakfast - (Toast, Donut, Bagels) 

So far, I'm using this.

| dbxquery shortnames=t connection=xxx query="select sale_type,sale_category, avg(execmin) as min,avg(execmean) as mean, avg(execmax)as max from
(Select sale_type,sale_category,execmin,execmax,execmean,object from XXX)
group by sale_type,sale_category" | search sale_type=$saletype$

Thank you.

Tags (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Depending on how you populate the dropdowns, you could use the token from the first dropdown to filter the choices for the second dropdown.

0 Karma

aganguri
Observer

Can you please explain more on how to perform that.

Currently I'm using dbxquery to fetch the data from database, but when I use the same splunk search under dynamic drop-down functionality to generate the fields, it is not populating the data I don't see any entries. 

| dbxquery shortnames=t connection=xxx query="select sale_item from sales_table"

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please share your dashboard source code.

0 Karma

aganguri
Observer

Any help on this please.

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...