Dashboards & Visualizations

Why are values for a dynamic checkbox not being populated by variables passed from 2 drop-downs?

vdevarayan
Path Finder

I have a top level form with two drop-downs - say Department & Employee
Department drop-down has unique dept names. Once a dept is selected, all employees in that dept get populated in the second drop-down. The values of the selected drop-down are available in $dept$ and $empname$

So far, so good.

Now, I have a panel in the dashboard that uses the above variables ($dept$, $empName)

The problem i am having is that the $dept$, $empName$ is NOT getting substituted inside the form with checkbox.

Here is my source code:

<panel>
  <input type="checkbox" token="cbstring" searchWhenChanged="true">
    <choice value="source=/shome/dept-emp.txt deptName=$dept$ empName=$empName$ | timechart max(somecol) ">Max</choice>
    <choice value="source=/shome/dept-emp.txt deptName=$dept$ empName=$empName$ | timechart max(somecol) ">Avg</choice>
    <choice value="source=/shome/dept-emp.txt deptName=$dept$ empName=$empName$ | timechart max(somecol) ">Min</choice>
    <prefix> |</prefix>
    <suffix> </suffix>
    <!-- Each value will be surrounded by the valuePrefix and valueSuffix -->
    <valuePrefix> appendcols [search </valuePrefix>
    <valueSuffix> ] </valueSuffix>
    <!-- All the values and their valuePrefix and valueSuffix will be concatenated together with the delimiter between them -->
    <delimiter> | </delimiter>
  </input>
  <chart>
        <searchString>"source=/shome/dept-emp.txt deptName=$dept$ empName=$empName$ | timechart max(somecol) " $cbstring$</searchString>
  </chart>
</panel>

Search does not return any results as it is trying to search for "$dept$" instead of the substituted values.
I tried with $$dept$$, '$dept$' - nothing worked.

Any suggestions?

1 Solution

vdevarayan
Path Finder

Figured it out.
Solution is to keep the variables $dept$ outside of the choice tag and use prefix. That worked

View solution in original post

0 Karma

vdevarayan
Path Finder

Figured it out.
Solution is to keep the variables $dept$ outside of the choice tag and use prefix. That worked

0 Karma

adeelzafar
Engager

Hi vdevaryan.. I have exactly same issue... Can you please provide more details on how you resolved it?

I mean can you please share your code of using prefix for $dept$..

Thanks a lot buddy.

0 Karma

vdevarayan
Path Finder

Followup to the above question:
I followed the documentation from
http://docs.splunk.com/Documentation/Splunk/6.2.2/Viz/PanelreferenceforSimplifiedXML

0 Karma
Get Updates on the Splunk Community!

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

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

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...