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!

Enterprise Security Content Update (ESCU) | New Releases

In September, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...