Dashboards & Visualizations

Dropdown variables

DTERM
Contributor

Let's say I have the following query:

index=myapp supportgroup=$supportgroup$ | top productName

where some value will be substituted for $supportgroup$, for example helpdesk, or HR, etc...

I need help populating the searchTemplate and populatingSearch tags for a dropdown I'm working on. I only need help with those two lines. The rest of the dropdown works fine.

Here's what I have.

<searchTemplate>index=myapp supportGroup=$supportGroup$ | top productName </searchTemplate>

<populatingSearch fieldForValue="supportGroup" fieldForLabel="supportGroup"><![CDATA[index=myapp supportGroup | top productName ]]></populatingSearch>

Those lines are not producing the desired output based on my search above. Please help. Thanks in advance.

Tags (1)
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

well with that <populatingSearch> you're telling it to run

index=myapp supportGroup | top productName

and then in those search results, look for a 'supportGroup' field. But there wont be a supportGroup field there.

Also, note that top by default will only return the top 10 values.

You probably want

index=myapp supportGroup | stats count by supportGroup

or

index=myapp supportGroup | top 100 supportGroup

View solution in original post

sideview
SplunkTrust
SplunkTrust

well with that <populatingSearch> you're telling it to run

index=myapp supportGroup | top productName

and then in those search results, look for a 'supportGroup' field. But there wont be a supportGroup field there.

Also, note that top by default will only return the top 10 values.

You probably want

index=myapp supportGroup | stats count by supportGroup

or

index=myapp supportGroup | top 100 supportGroup
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 ...