<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Escape &amp;lt; and &amp;gt; in the xml of dashboards in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Escape-lt-and-gt-in-the-xml-of-dashboards/m-p/15109#M332</link>
    <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I got the following error when I tried to save a dashboard after editing its xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Encountered the following error while trying to update: In handler 'views': Not valid XML: &amp;lt;view template="dashboard.html....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;lt; and &amp;gt; characters are part of my search String because I'm using  the rex search command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..
&amp;lt;module name="HiddenSearch" autoRun="True"&amp;gt;
  &amp;lt;param name="search"&amp;gt;| savedsearch "Mysearch" | where isnotnull(Resource) | rex "r&amp;gt; (\[.*\] )*(?&amp;lt;Reason&amp;gt;.*)$" | fields host,hostname,Resource,Reason&amp;lt;/param&amp;gt;
..
.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do those characters have to be escaped?&lt;/P&gt;</description>
    <pubDate>Wed, 09 Jun 2010 01:07:15 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2010-06-09T01:07:15Z</dc:date>
    <item>
      <title>Escape &lt; and &gt; in the xml of dashboards</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Escape-lt-and-gt-in-the-xml-of-dashboards/m-p/15109#M332</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;I got the following error when I tried to save a dashboard after editing its xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Encountered the following error while trying to update: In handler 'views': Not valid XML: &amp;lt;view template="dashboard.html....
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&amp;lt; and &amp;gt; characters are part of my search String because I'm using  the rex search command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;..
&amp;lt;module name="HiddenSearch" autoRun="True"&amp;gt;
  &amp;lt;param name="search"&amp;gt;| savedsearch "Mysearch" | where isnotnull(Resource) | rex "r&amp;gt; (\[.*\] )*(?&amp;lt;Reason&amp;gt;.*)$" | fields host,hostname,Resource,Reason&amp;lt;/param&amp;gt;
..
.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How do those characters have to be escaped?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2010 01:07:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Escape-lt-and-gt-in-the-xml-of-dashboards/m-p/15109#M332</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2010-06-09T01:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: Escape &lt; and &gt; in the xml of dashboards</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Escape-lt-and-gt-in-the-xml-of-dashboards/m-p/15110#M333</link>
      <description>&lt;P&gt;There are two ways:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Use &lt;CODE&gt;&amp;amp;lt;&lt;/CODE&gt; for &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;amp;gt;&lt;/CODE&gt; for &lt;CODE&gt;&amp;gt;&lt;/CODE&gt;. You should also use &lt;CODE&gt;&amp;amp;amp;&lt;/CODE&gt; for any &lt;CODE&gt;&amp;amp;&lt;/CODE&gt; and some people like to use &lt;CODE&gt;&amp;amp;quot;&lt;/CODE&gt; for &lt;CODE&gt;"&lt;/CODE&gt;.&lt;/LI&gt;
&lt;LI&gt;Enclose the entire search string in a CDATA tag: `(?.)" | stats count ]]&amp;gt;'&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I personally think that it's a lot clearer to just use CDATA so your search query is readable:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;module name="HiddenSearch" autoRun="True"&amp;gt;
    &amp;lt;param name="search"&amp;gt;&amp;lt;![CDATA[
      | savedsearch "Mysearch" | where isnotnull(Resource) | rex "r&amp;gt; (\[.*\] )*(?&amp;lt;Reason&amp;gt;.*)$" | fields host,hostname,Resource,Reason
    ]]&amp;gt;&amp;lt;/param&amp;gt;
    ...
 ...
 ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Jun 2010 02:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Escape-lt-and-gt-in-the-xml-of-dashboards/m-p/15110#M333</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-06-09T02:16:59Z</dc:date>
    </item>
  </channel>
</rss>

