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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...