All Apps and Add-ons

How to assign dynamic value from multi-select input to table command in Horizon Chart - Custom Visualization?

pratapbhanu2047
Engager

Hello,

I am trying to use "table command" to list values which i have selected in multi-select input in dashboard.
where "Host" is value from multi select drop down of dashboard and "KPI" is value which is created by ..... | eval {counter}=Value.

below is query of panel which i am trying to Plot in horizon chart.

host=ABCD and DCBA
KPI=% Space Used and % Processor Time

eg:-

index="n_*1_idx" host IN ($host$)
| eval {counter}=Value  | timechart span=5m avg($KPI$)
|table _time avg*

Note: the above query works fine, but as soon as i select second KPI in Multi-select input, Horizon chart does not show any data.

I want something like below:-

index="n_*1_idx" host IN ($host$)
| eval {counter}=Value  | timechart span=5m avg($KPI$)
|table _time avg(% Space Used) avg(% Processor Time).

I would greatly appreciate any help. thanks in advance.

0 Karma
1 Solution

maciep
Champion

not sure if you actually need to table the fields after timechart, since timechart kinda does that already? If not, maybe change your multi-select input to build a token that contains all of the aggregates you need.

Token Value Prefix: avg(
Token Value Suffix: )
Delimiter: ,

and so now your KPI token will contain avg(kpi1), avg(kpi2),.. so you can then just

... | timechart span=5m $KPI$

View solution in original post

maciep
Champion

not sure if you actually need to table the fields after timechart, since timechart kinda does that already? If not, maybe change your multi-select input to build a token that contains all of the aggregates you need.

Token Value Prefix: avg(
Token Value Suffix: )
Delimiter: ,

and so now your KPI token will contain avg(kpi1), avg(kpi2),.. so you can then just

... | timechart span=5m $KPI$

pratapbhanu2047
Engager

@maciep, thanks for helping out. yes i did followed same and used Token Value prefix..

index="n_*1_idx" host IN ($host$)
| eval {counter}=Value | timechart span=5m avg($KPI$) avg($KPI1$) avg($KPI2$)

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...