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!

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 ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...