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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...