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!

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...

Splunk AppDynamics Agents Webinar Series

Mark your calendars! On June 24th at 12PM PST, we’re going live with the second session of our Splunk ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...