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!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...