<?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: How to create the Regular Expression for the xml in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361651#M106825</link>
    <description>&lt;P&gt;Why not use &lt;CODE&gt;spath&lt;/CODE&gt; (you can certainly go with @richgalloway's answer)?&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2017 20:01:23 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-06-22T20:01:23Z</dc:date>
    <item>
      <title>How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361648#M106822</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have XML in the format present below and i am trying to use field transformation and field extraction in order to extract the field in people format.&lt;/P&gt;

&lt;P&gt;Could you please help me in creating regular expression for this xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;ns4:includeme&amp;gt;false&amp;lt;/ns4:includeme&amp;gt;
&amp;lt;m:houseref&amp;gt;21&amp;lt;/m:houseref&amp;gt;
&amp;lt;m1:security&amp;gt;***&amp;lt;/m1:security&amp;gt;
&amp;lt;Name&amp;gt;Argus&amp;lt;/Name&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to have a single regular expression which i can use to extract all the field values and field name.&lt;/P&gt;

&lt;P&gt;I tried to use below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;- \&amp;lt;\w?\w?\d?\:([^\&amp;gt;]+)\&amp;gt;([^\&amp;lt;]+)\&amp;lt;\/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But its not capturing the last one Argus&lt;/P&gt;

&lt;P&gt;So i would like to know if it can be possible if yes then what would be the expression.&lt;/P&gt;

&lt;P&gt;Many Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 15:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361648#M106822</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-06-22T15:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361649#M106823</link>
      <description>&lt;P&gt;@m7787580, any reason you are not using spath or xpath command?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 17:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361649#M106823</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-06-22T17:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361650#M106824</link>
      <description>&lt;P&gt;Your regex string was very close.  The colon is optional so I put a question mark after it in the regex.  This worked for me on regex101.com with your sample data.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\&amp;lt;\w?\w?\d?\:?([^\&amp;gt;]+)\&amp;gt;([^\&amp;lt;]+)\&amp;lt;\/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jun 2017 17:59:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361650#M106824</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-06-22T17:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361651#M106825</link>
      <description>&lt;P&gt;Why not use &lt;CODE&gt;spath&lt;/CODE&gt; (you can certainly go with @richgalloway's answer)?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2017 20:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361651#M106825</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-22T20:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361652#M106826</link>
      <description>&lt;P&gt;Thanks for coming back to me.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;Na**me**&amp;gt;Argus&amp;lt;/Name&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then it is only capturing me part from Name and i want full Name to be rexed out.&lt;/P&gt;

&lt;P&gt;Many Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 08:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361652#M106826</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-06-23T08:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361653#M106827</link>
      <description>&lt;P&gt;Hi Richgalloway's&lt;/P&gt;

&lt;P&gt;I am not sure how to use spath.&lt;/P&gt;

&lt;P&gt;If you help me in understanding the syntax and usage it would be helpfull.&lt;/P&gt;

&lt;P&gt;Many Thanks,&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 09:50:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361653#M106827</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-06-23T09:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361654#M106828</link>
      <description>&lt;P&gt;You are going to LOVE this.  Just add this to the end of your existing search and freak out:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| spath
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Jun 2017 10:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361654#M106828</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-23T10:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361655#M106829</link>
      <description>&lt;P&gt;Hi wood,&lt;/P&gt;

&lt;P&gt;I still cannot see the fields getting extracted &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2017 10:21:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361655#M106829</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-06-23T10:21:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the Regular Expression for the xml</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361656#M106830</link>
      <description>&lt;P&gt;Try this and then figure out what is what is wonky in your search (by default it works from the &lt;CODE&gt;_raw&lt;/CODE&gt; field)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="&amp;lt;ns4:includeme&amp;gt;false&amp;lt;/ns4:includeme&amp;gt;
&amp;lt;m:houseref&amp;gt;21&amp;lt;/m:houseref&amp;gt;
&amp;lt;m1:security&amp;gt;***&amp;lt;/m1:security&amp;gt;
&amp;lt;Name&amp;gt;Argus&amp;lt;/Name&amp;gt;"
| spath
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 24 Jun 2017 16:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-the-Regular-Expression-for-the-xml/m-p/361656#M106830</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-24T16:03:27Z</dc:date>
    </item>
  </channel>
</rss>

