Hi @niketnilay
Below is the complete code.
Am trying to show the status of each light, So the colour will change to green and red per the range map.
Now i need to click the icon to drill down to which light went down.
I created a Panel and need to pass tok_id to get the results.
Hope now am clear in my requirements.
<form>
<label>AGLCMS v3</label>
<search id="taxi">
<query> | inputlookup RETIL_lookup
| dedup FixtureID
| join type=left FixtureID
[ search index=main host="DC2VPLSPSH4" source="AGLCMS.csv"
| rename "Field 1" as "FixtureID"
| rename "Field 2" as Name
| table "FixtureID" "Name"]
| eval Status=if(isnull(Name), "0","1")
</query>
<earliest>0</earliest>
<latest></latest>
</search>
<search base="taxi">
<query>| search FixtureID="4TXC18-087AB" | rangemap field=Status low=0-0 severe=1-10| table FixtureID Status range</query>
<progress>
<set token="M12A_1">$result.range$</set>
<set token="M12A_11">$result.FixtureID$</set>
</progress>
</search>
<search base="taxi">
<query>| search FixtureID="4TXC18-085AB" | rangemap field=Status low=0-0 severe=1-10 | table Status range</query>
<progress>
<set token="M12A_2">$result.range$</set>
</progress>
</search>
<search base="taxi">
<query>| search FixtureID="4TXC18-086AB" | rangemap field=Status low=0-0 severe=1-10 | table Status range</query>
<progress>
<set token="M12A_3">$result.range$</set>
</progress>
</search>
<search base="taxi">
<query>| search FixtureID="3TXC17-086AB" | rangemap field=Status low=0-0 severe=1-10 | table Status range</query>
<progress>
<set token="M12A_4">$result.range$</set>
</progress>
</search>
<search base="taxi">
<query>| search FixtureID="3TXC17-087AB" | rangemap field=Status low=0-0 severe=1-10 | table Status range</query>
<progress>
<set token="M12A_5">$result.range$</set>
</progress>
</search>
<search base="taxi">
<query>| search FixtureID="3TXC17-088AB" | rangemap field=Status low=0-0 severe=1-10 | table Status range</query>
<progress>
<set token="M12A_6">$result.range$</set>
</progress>
</search>
<row depends="$hide$">
<panel>
<html>
<style>
.custom-result-value {
font-size: 35px;
margin: 35px auto;
text-align: center;
color: rgb(85, 85, 85);
display: inline-block;
padding:0px;
margin:0px;
}
.severe.custom-result-value:before {
content: "\25cf";
}
.severe.custom-result-value {
color: rgb(255, 0, 0);
}
.low.custom-result-value {
color: rgb(0, 247, 0);
}
.low.custom-result-value:before {
content: "\25cf";
}
.custom-result-value.icon-only {
}
.view---pages-enterprise---6-6-3---14_Tp{color:#fbca25;}
.dashboard-row .dashboard-panel h2.panel-title {
font-size: 25px;
font-weight: 600;
padding: 12px 20px 7px 12px;
text-align: center;
}
.dashboard-header h2 {
font-weight: bold;
}
.dashboard-panel {
border: 1px solid black;
border-radius: 6px;
}
.dashboard-body {
padding: 0 20px 20px;
color: #2f2c59;
background-color: #aea8bd;
min-height: 150px;
}
.highcharts-container {
border-radius: 6px;
}
.panel-head {
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.dashboard-header h2 {
font-weight: bold;
}
#icon {
text-align:center;
}
</style>
</html>
</panel>
</row>
<row>
<panel>
<title>M12A</title>
<html>
<div id="icon">
<div class="custom-result-value $M12A_1$"> </div>
<div class="custom-result-value $M12A_2$"> </div>
<div class="custom-result-value $M12A_3$"> </div>
<div class="custom-result-value $M12A_4$"> </div>
<div class="custom-result-value $M12A_5$"> </div>
<div class="custom-result-value $M12A_6$"> </div>
</div>
</html>
</panel>
</row>
<row depends="$tok_id$">
<panel>
<title>Detail</title>
<table>
<search>
<query>index=main source="LampFailures.csv" host="DC2VPLSPSH4"
| rename "Fixture ID" as FixtureID
| table Timestamp FixtureID "MH No" "Fitting Type" Color "Lamp Power" Location Remarks
| join FixtureID
[| inputlookup RETIL_lookup
| fields - "X-Position" "Y-Position" Description]
| sort - Timestamp
| search FixtureID="$tok_id$"</query>
<earliest>0</earliest>
<latest></latest>
</search>
<option name="drilldown">none</option>
<option name="refresh.display">progressbar</option>
</table>
</panel>
</row>
<row>
<html>
<script>
require(
[
'jquery',
'splunkjs/mvc'
],
function ($, mvc) {
var unsubmittedTokenModel=mvc.Components.get("default");
$(document).on('click','div[id^="custom-result-"]',function () {
unsubmittedTokenModel.set("tokClickedValue",$(this).html());
});
});
</script>
</html>
</row>
</form>
Thanks in advance.
I have added the image for sample
... View more