Dashboards & Visualizations

Tokens not working in the panels

aditsss
Motivator

Hi Everyone,

I have two dropdowns and they are not working in the panels

Can someone guide me on that:

Below is my current code:

Dropdown:

<input type="dropdown" token="req" searchWhenChanged="true">
<label>Request Type</label>
<choice value="*">All Request_Type</choice>
<search>
<query>index=abc sourcetype=xyz source="user.log" process-groups | rex "\)\s+(?&lt;Request_Type&gt;[^ ]+)"|stats count by Request_Type </query>
<earliest>-60d@d</earliest>
<latest>now</latest>
</search>
<fieldForLabel>Request_Type</fieldForLabel>
<fieldForValue>Request_Type</fieldForValue>
<prefix>Request_Type="</prefix>
<suffix>"</suffix>
<initialValue>*</initialValue>
<default>*</default>
</input>
<input type="dropdown" token="usr" searchWhenChanged="true">
<label>NiFi_Users</label>
<choice value="*">All Users</choice>
<search>
<query>index=abc sourcetype=xyz source="user.log" process-groups | rex "\&lt;(?&lt;Request_User&gt;\w+)\&gt;\&lt;"|stats count by Request_User</query>
<earliest>-60d@d</earliest>
<latest>now</latest>
</search>
<fieldForLabel>Request_User</fieldForLabel>
<fieldForValue>Request_User</fieldForValue>
<prefix>Request_User="</prefix>
<suffix>"</suffix>
<initialValue>*</initialValue>
<default>*</default>
</input>

Panel Code:

1st PANEL

<panel>
<chart>
<title>NiFi_Operations</title>
<search>
<query>index=abc sourcetype=uio source="user.log" process-groups |rex "\)\s+(?&lt;Request_Type&gt;[^ ]+)"|chart count(Request_Type) as "Request- Types" by Request_Type |search $req$ $usr$</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
</search>

2nd Panel

<panel>
<chart>
<title>NiFi_Users</title>
<search>
<query>index=abc sourcetype=xyz source="user.log" process-groups |rex "\&lt;(?&lt;Request_User&gt;\w+)\&gt;\&lt;"|chart count(Request_User) as "Users" by Request_User|search $usr$ $req$</query>
<earliest>$field1.earliest$</earliest>
<latest>$field1.latest$</latest>
</search>

I have extracted the field Request User and RequestType.

Can someone guide me why the t

 

Labels (3)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...