Hi, I tried to add a piece of code to change the color of values based on certain condition, but it is not reflecting the change in my dashboard. Can you please check & advise what is going wrong?
...
See more...
Hi, I tried to add a piece of code to change the color of values based on certain condition, but it is not reflecting the change in my dashboard. Can you please check & advise what is going wrong?
New code added -
<single id="CurrentUtilisation">
<search>
<query>
<![CDATA[
index=usage_index_summary
| fields Index as sourceIndex, totalRawSizeGB
| where Index="$single_index_name$"
| stats latest(totalRawSizeGB) as CurrentSize by Index
| join left=L right=R where L.Index=R.extracted_Index
[ search index=index_configured_limits_summary
| stats
latest(maxGlobalDataSizeGB) as MaxSizeGB
by extracted_Index
]
| rename L.CurrentSize as CurrentSizeGB, R.MaxSizeGB as MaxSizeGB, L.Index as Index
| eval unit_label = if(CurrentSizeGB < 1, "MB", "GB")
| eval CurrentSizeGB = if(CurrentSizeGB < 1, CurrentSizeGB*1024, CurrentSizeGB)
| eval CurrentSizeDisplay = round(CurrentSizeGB) . if(unit_label == "MB", "MB", "GB")
| eval CurrentSizeDisplay = if(CurrentSizeGB == 0, "None", CurrentSizeDisplay)
| eval range=if(CurrentSizeGB > MaxSizeGB, "over", "under")
| table CurrentSizeDisplay, range
]]>
</query>
</search>
<option name="colorBy">value</option>
<option name="drilldown">none</option>
<option name="rangeColors">["red", "white"]</option>
<option name="refresh.display">progressbar</option>
<option name="trellis.enabled">0</option>
<option name="underLabel">Current Utilisation</option>
<option name="useColors">1</option>
</single>
What I want - If Currentsize > Maxsize then the value should display in Red else White. The query on being run independently is showing correct results for the range & current size maxsize values but the color does not change in the dashboard. I have looked up this in the community & tried using the same logic mentioned in this successful solution but to no avail.
Reference used - https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.splunk.com%2Ft5%2FDashboards-Visualizations%2FHow-can-I-change-Splunk-Dashboard-single-value-field-color-of%2Ftd-p%2F596833&data=05%7C02%7Csaleha.shaikh%40here.com%7C8e67306234504904e1c008dc7a4ac122%7C6d4034cd72254f72b85391feaea64919%7C0%7C0%7C638519708691080704%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=iJit6osuY09q25VX8pWiUcuylKtrNczG4H%2BhCfSgEbo%3D&reserved=0