Splunk Search

How to pass token in dashbaord

Vani_26
Path Finder

Below is my original xml code for dashboard.

from the panel of EPP TimeZone , i have modified the query using tstats, query is working fine, but when i compare with original xml code query i am not able to pass tokens ((prodct="$eppProduct$") OR site="$eppProduct$")) in my tstats query.
can anyone please help on this.

 

<form>
<label>EPP Mode Dashboard</label>
<fieldset submitButton="false" autoRun="true">
<input type="dropdown"  token="eppProduct" searchWhenChanged="true">
<label>Product</label>
<fieldForLabel>all_product</fieldForLabel>
<fieldForValue>all_product</fieldForValue>
<search>
<query> |tstats count where index=epp-prd-clc by site host host_ip
|eval prodct= case(like(host, "%prod%"), "PROD", like(host, "%pat%"), "PAT", like(host, "%sit%"), "SIT", like(host, "%dev%"), "DEV")
|stats count by site prodct
|eval all_product=if(like(prodct, "PROD"), site, prodct)</query>
<earliest> -4h@h </earliest>
<latest>now</latest>
</search>
<default>*</default>
<intialValue>*</intialValue>
<choice value="*"> ALL </choice>
</input>
<input type="time" token "eppTime" searchWhenChanged="true"
<label>Time</label>
<default>
<earliest> -60m@m </earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<title>EPP TimeZone</title>
<chart>
<title> Average Response Time</title>
<search>
<query> index=epp-prd-clc  variable="ap" virginal="ssc" (prodct="$eppProduct$") OR site="$eppProduct$") deposit="calp" |eval Deposit=upper(deposit) |timechart avg(duration) as Duration
|eval Duration=round(Duration,2)</query>
<earliest> $eppTime.earliest$ </earliest>
<latest>$eppTime.latest$</latest>
</search>
<option nmae="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisMiddle  </option>
<option nmae="charting.axisLabelsX.majorLabelStyle.rotation">0  </option>
<option nmae="charting.chart"> line </option>
<option nmae="charting.chart.nullValueMode"> zero </option>
<option nmae="charting.chart.showDataLabels">minmax  </option>
<option nmae="charting.drilldown>all  </option>
<option nmae="charting.layout.splitSeries"> 1 </option>
<option nmae="referesh.display"> none </option>
</chart>
</panel>
</row>
</form>

 

below is the modified xml dashboard code using tstats.

 

<form>
<label>EPP Mode Dashboard</label>
<fieldset submitButton="false" autoRun="true">
<input type="dropdown"  token="eppProduct" searchWhenChanged="true">
<label>Product</label>
<fieldForLabel>all_product</fieldForLabel>
<fieldForValue>all_product</fieldForValue>
<search>
<query> |tstats count where index=epp-prd-clc by site host host_ip
|eval prodct= case(like(host, "%prod%"), "PROD", like(host, "%pat%"), "PAT", like(host, "%sit%"), "SIT", like(host, "%dev%"), "DEV")
|stats count by site prodct
|eval all_product=if(like(prodct, "PROD"), site, prodct)</query>
<earliest> -4h@h </earliest>
<latest>now</latest>
</search>
<default>*</default>
<intialValue>*</intialValue>
<choice value="*"> ALL </choice>
</input>
<input type="time" token "eppTime" searchWhenChanged="true"
<label>Time</label>
<default>
<earliest> -60m@m </earliest>
<latest>now</latest>
</default>
</input>
</fieldset>
<row>
<panel>
<title>EPP TimeZone</title>
<chart>
<title> Average Response Time</title>
<search>
<query> |tstats avg(duration) as Duration where index=epp-prd-clc  TERM(variable) TERM("ap")TERM(virginal) TERM("ssc") TERM(deposit) TERM("calp") BY PREFIX(deposit:) _time
|rename deposit: as Deposit
 |eval Deposit=upper(deposit) |timechart 
|eval Duration=round(Duration,2)</query>
<earliest> $eppTime.earliest$ </earliest>
<latest>$eppTime.latest$</latest>
</search>
<option nmae="charting.axisLabelsX.majorLabelStyle.overflowMode">ellipsisMiddle  </option>
<option nmae="charting.axisLabelsX.majorLabelStyle.rotation">0  </option>
<option nmae="charting.chart"> line </option>
<option nmae="charting.chart.nullValueMode"> zero </option>
<option nmae="charting.chart.showDataLabels">minmax  </option>
<option nmae="charting.drilldown>all  </option>
<option nmae="charting.layout.splitSeries"> 1 </option>
<option nmae="referesh.display"> none </option>
</chart>
</panel>
</row>
</form>

 

 

 

Labels (2)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What exactly do you mean by "i am not able to pass tokens ...in my tstats query"?  What is stopping you?

---
If this reply helps you, Karma would be appreciated.
0 Karma

Vani_26
Path Finder

below is my tstats query, how to pass this token (prodct="$eppProduct$") OR site="$eppProduct$")
in this query:

i pasted original query also, in original query tokens are there but when i trying to pass in tstats its not working

|tstats avg(duration) as Duration where index=epp-prd-clc  TERM(variable) TERM("ap")TERM(virginal) TERM("ssc") TERM(deposit) TERM("calp") BY PREFIX(deposit:) _time
|rename deposit: as Deposit
 |eval Deposit=upper(deposit) |timechart 
|eval Duration=round(Duration,2)

orginal query:

index=epp-prd-clc  variable="ap" virginal="ssc" (prodct="$eppProduct$") OR site="$eppProduct$") deposit="calp" |eval Deposit=upper(deposit) |timechart avg(duration) as Duration
|eval Duration=round(Duration,2)

 

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Those queries were in the OP.  I still don't know what "its not working" means.  What results do you get?  What results are you expecting?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...