Dashboards & Visualizations

Why am I receiving error while adding query to dashboard?

Macky_29
Explorer

Hi Experts, 

While adding below query to my dashboard i am getting error saying  

 

|eval Category=case (Ratings>"8","Promoter",Ratings > "7","Detractor",Ratings > "6" AND Ratings < "9", "Passive")

Error: Unencoded <

Macky_29_0-1675029081860.png

 

Regards

Mayank

 

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

Inside the XML you need to escape characters

so 

|eval Category=case (Ratings &gt; "8","Promoter",Ratings &gt;  "7","Detractor",Ratings &gt;  "6" AND Ratings &lt; "9", "Passive")

https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents#:~:....

Actually you don't need to escape the > to &gt; but it's probably good practice.

View solution in original post

SanjayReddy
SplunkTrust
SplunkTrust

Hi @Macky_29 

Below is the mapping of special characters with html entty, either you can use mapping word

enclose the query in cdata tags

<![CDATA[
<content_with_special_characters>
]]>

 

https://docs.splunk.com/Documentation/SplunkCloud/latest/Viz/OverviewofSimplifiedXML

SanjayReddy_0-1675082027619.png

 

bowesmana
SplunkTrust
SplunkTrust

Inside the XML you need to escape characters

so 

|eval Category=case (Ratings &gt; "8","Promoter",Ratings &gt;  "7","Detractor",Ratings &gt;  "6" AND Ratings &lt; "9", "Passive")

https://stackoverflow.com/questions/1091945/what-characters-do-i-need-to-escape-in-xml-documents#:~:....

Actually you don't need to escape the > to &gt; but it's probably good practice.

Get Updates on the Splunk Community!

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...

Cloud Platform & Enterprise: Classic Dashboard Export Feature Deprecation

As of Splunk Cloud Platform 9.3.2408 and Splunk Enterprise 9.4, classic dashboard export features are now ...

Explore the Latest Educational Offerings from Splunk (November Releases)

At Splunk Education, we are committed to providing a robust learning experience for all users, regardless of ...