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
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

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