<?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 Editing the dashboard source XML for a conditional count search, why am I getting error &amp;quot;StartTag: invalid element name&amp;quot;? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266607#M16834</link>
    <description>&lt;P&gt;I am trying to count events where a field is in between a couple of ranges.&lt;BR /&gt;
My field is &lt;STRONG&gt;detail.id&lt;/STRONG&gt; which has the following format -&amp;gt; A1234567B&lt;/P&gt;

&lt;P&gt;First thing I do is substring out the digits, then check if the digits are in certain ranges, and then count them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch | eval id=substr(detail.id,2,7) | eval ps_id = if((id &amp;gt;= 2700000 AND id &amp;lt;= 2,704,999) OR (id &amp;gt;= 2730000 AND id &amp;lt;= 2735999), 1, 0) | stats sum(ps_id) as count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am editing the source xml for a dashboard so when I try and save this, I get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Encountered the following error while trying to update: In handler 'views': Error parsing XML on line 77: StartTag: invalid element name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This seems to be something with the &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; since when I take it out, I can save it, but the search, however, doesn't work.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 13:05:13 GMT</pubDate>
    <dc:creator>dan_pudwell</dc:creator>
    <dc:date>2016-03-31T13:05:13Z</dc:date>
    <item>
      <title>Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266607#M16834</link>
      <description>&lt;P&gt;I am trying to count events where a field is in between a couple of ranges.&lt;BR /&gt;
My field is &lt;STRONG&gt;detail.id&lt;/STRONG&gt; which has the following format -&amp;gt; A1234567B&lt;/P&gt;

&lt;P&gt;First thing I do is substring out the digits, then check if the digits are in certain ranges, and then count them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;baseSearch | eval id=substr(detail.id,2,7) | eval ps_id = if((id &amp;gt;= 2700000 AND id &amp;lt;= 2,704,999) OR (id &amp;gt;= 2730000 AND id &amp;lt;= 2735999), 1, 0) | stats sum(ps_id) as count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am editing the source xml for a dashboard so when I try and save this, I get the following error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Encountered the following error while trying to update: In handler 'views': Error parsing XML on line 77: StartTag: invalid element name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This seems to be something with the &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; since when I take it out, I can save it, but the search, however, doesn't work.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 13:05:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266607#M16834</guid>
      <dc:creator>dan_pudwell</dc:creator>
      <dc:date>2016-03-31T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266608#M16835</link>
      <description>&lt;P&gt;The commas in 2,704,999 break the eval command. The following test command worked -&lt;/P&gt;

&lt;P&gt;baseSearch &lt;BR /&gt;
| eval detailid="A1234567B"&lt;BR /&gt;
| eval id=substr(detailid,2,7)&lt;BR /&gt;
| eval ps_id = if((id &amp;gt;= 2700000 AND id &amp;lt;= 2704999) OR (id &amp;gt;= 2730000 AND id &amp;lt;= 2735999), 1, 0) &lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266608#M16835</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-03-31T14:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266609#M16836</link>
      <description>&lt;P&gt;I probably should have updated that without the comments.  Now I can't as my reputation is too low.&lt;BR /&gt;
The stats sum(ps_id) as count however returns 0?&lt;BR /&gt;
Also still getting the error when editing the source of the dashboard?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266609#M16836</guid>
      <dc:creator>dan_pudwell</dc:creator>
      <dc:date>2016-03-31T14:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266610#M16837</link>
      <description>&lt;P&gt;b/c ps_id is 0 ....&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:24:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266610#M16837</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-03-31T14:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266611#M16838</link>
      <description>&lt;P&gt;but in my test data it shouldn't be&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266611#M16838</guid>
      <dc:creator>dan_pudwell</dc:creator>
      <dc:date>2016-03-31T14:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Editing the dashboard source XML for a conditional count search, why am I getting error "StartTag: invalid element name"?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266612#M16839</link>
      <description>&lt;P&gt;Within XML, in any literals or eval-type code, you have to encode the &lt;CODE&gt;&amp;lt;&lt;/CODE&gt; and &lt;CODE&gt;&amp;gt;&lt;/CODE&gt; in order for the system not to think you are writing XML tags.  (And the commas in the number is a problem also.)&lt;/P&gt;

&lt;P&gt;so, ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval ps_id = if((id &amp;gt;= 2700000 AND id &amp;lt;= 2,704,999) OR (id &amp;gt;= 2730000 AND id &amp;lt;= 2735999), 1, 0)  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... should be written as ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval ps_id = if((id &amp;gt;= 2700000 AND id &amp;lt;= 2704999) OR (id &amp;gt;= 2730000 AND id &amp;lt;= 2735999), 1, 0)  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 16:14:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Editing-the-dashboard-source-XML-for-a-conditional-count-search/m-p/266612#M16839</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-05T16:14:51Z</dc:date>
    </item>
  </channel>
</rss>

