<?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 Re: search fails in xml file in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67309#M16831</link>
    <description>&lt;P&gt;The problem with your search is the "&amp;gt;" and "&amp;lt;".  The angel brackets are treated as part of XML tags.  Replace those with the HTML entities &amp;amp; lt; and &amp;amp; gt; .  Hope that fixes your problem.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Sep 2012 20:15:05 GMT</pubDate>
    <dc:creator>bmacias84</dc:creator>
    <dc:date>2012-09-21T20:15:05Z</dc:date>
    <item>
      <title>search fails in xml file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67308#M16830</link>
      <description>&lt;P&gt;The following search works fine in the Splunk search: &lt;/P&gt;

&lt;P&gt;index=mydata | rex "\s+IP\s+(?&lt;SRC_IP&gt;\d+.\d+.\d+.\d+).(?&lt;SRC_PORT&gt;\S+)\s+&amp;gt;\s+(?&lt;DEST_IP&gt;\d+.\d+.\d+.\d+).(?&lt;DEST_PORT&gt;[a-z0-9]+):\s+" | top src_ip&lt;/DEST_PORT&gt;&lt;/DEST_IP&gt;&lt;/SRC_PORT&gt;&lt;/SRC_IP&gt;&lt;/P&gt;

&lt;P&gt;When I take that same search and place it in an xml file like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;searchTemplate&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;index=dns | rex "\s+IP\s+(?&lt;SRC_IP&gt;\d+.\d+.\d+.\d+).(?&lt;SRC_PORT&gt;\S+)\s+&amp;gt;\s+(?&lt;DEST_IP&gt;\d+.\d+.\d+.\d+).(?&lt;DEST_PORT&gt;[a-z0-9]+):\s+" | top src_ip&lt;BR /&gt;
  &lt;/DEST_PORT&gt;&lt;/DEST_IP&gt;&lt;/SRC_PORT&gt;&lt;/SRC_IP&gt;&lt;/P&gt;

&lt;P&gt;It fails.  (That search in the XML starts and ends with the searchTemplate tags although I don't see those in this post, though they are there.)  I get the following error when trying to start Splunk:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Checking configuration... Error while parsing '/opt/splunk/etc/apps/myApp/default/data/ui/views/source.xml':
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;mismatched tag: line 6, column 4&lt;/P&gt;

&lt;P&gt;I don't see the mismatched tag.  What is the problem with the XML?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2012 19:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67308#M16830</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2012-09-21T19:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: search fails in xml file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67309#M16831</link>
      <description>&lt;P&gt;The problem with your search is the "&amp;gt;" and "&amp;lt;".  The angel brackets are treated as part of XML tags.  Replace those with the HTML entities &amp;amp; lt; and &amp;amp; gt; .  Hope that fixes your problem.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Sep 2012 20:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67309#M16831</guid>
      <dc:creator>bmacias84</dc:creator>
      <dc:date>2012-09-21T20:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: search fails in xml file</title>
      <link>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67310#M16832</link>
      <description>&lt;P&gt;Based on this response, I've created the following search:&lt;/P&gt;

&lt;P&gt;index=data | rex "\s+IP\s+(?&amp;lt;src_ip&amp;gt; \d+.\d+.\d+.\d+).(?&amp;lt;src_port&amp;gt;\S+)\s+&amp;gt;\s+(?&amp;lt;dest_ip&amp;gt;\d+.\d+.\d+.\d+).(?&amp;lt;dest_port&amp;gt;[a-z0-9]+):\s+" | top src_ip&lt;/P&gt;

&lt;P&gt;This still fails in the XML file.  Is there anything within Splunk that helps resolve such regular expressions?  Why does this not work?  What is incorrect?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:29:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/search-fails-in-xml-file/m-p/67310#M16832</guid>
      <dc:creator>DTERM</dc:creator>
      <dc:date>2020-09-28T12:29:55Z</dc:date>
    </item>
  </channel>
</rss>

