<?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 extract a string from a particular XML tags with regular expression? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440402#M125236</link>
    <description>&lt;P&gt;Just add &lt;CODE&gt;... | spath input=f&lt;/CODE&gt;, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval f="&amp;lt;Rmk&amp;gt;ABC*/ Work Direct---&amp;lt;/Rmk&amp;gt;"

| spath input=f
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Jun 2019 14:41:09 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-06-24T14:41:09Z</dc:date>
    <item>
      <title>How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440397#M125231</link>
      <description>&lt;P&gt;Dear Experts , &lt;BR /&gt;
Need your help with regular expression. I have an XML tag in the field f.&lt;BR /&gt;
I would like to extract all the characters including spaces (or) Special characters from this XML string &lt;CODE&gt;&amp;lt;Rmk&amp;gt;&lt;/CODE&gt;.&lt;BR /&gt;
I tried to use &lt;CODE&gt;search | rex field=f "\&amp;lt;Rmk\&amp;gt;"(?&amp;lt;Rmk&amp;gt;\w*)"\&amp;lt;\/Rmk\&amp;gt;"&lt;/CODE&gt; , however this regular expression is not giving any output.&lt;/P&gt;

&lt;P&gt;your help is much appreciated with this query.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;XML Tag :&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Rmk&amp;gt;ABC*/ Work Direct---&amp;lt;/Rmk&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Desired Output : ABC*/ Work Direct---&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 12:47:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440397#M125231</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-06-24T12:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440398#M125232</link>
      <description>&lt;P&gt;Hi kirangurram,&lt;BR /&gt;
try this regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\&amp;lt;Rmk\&amp;gt;(?&amp;lt;Rmk&amp;gt;[^\&amp;lt;]*)\&amp;lt;\/Rmk\&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440398#M125232</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-06-24T13:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440399#M125233</link>
      <description>&lt;P&gt;thanks for your help @gcusello . Your solution works.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 13:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440399#M125233</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-06-24T13:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440400#M125234</link>
      <description>&lt;P&gt;Hi kirangurram,&lt;BR /&gt;
if you're satisfied of this solution, please accept and/or upvote it.&lt;BR /&gt;
See next time.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:16:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440400#M125234</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-06-24T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440401#M125235</link>
      <description>&lt;P&gt;didn't see you commented there Giuseppe &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; deleting my answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440401#M125235</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-06-24T14:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a particular XML tags with regular expression?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440402#M125236</link>
      <description>&lt;P&gt;Just add &lt;CODE&gt;... | spath input=f&lt;/CODE&gt;, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults | eval f="&amp;lt;Rmk&amp;gt;ABC*/ Work Direct---&amp;lt;/Rmk&amp;gt;"

| spath input=f
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jun 2019 14:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-particular-XML-tags-with-regular/m-p/440402#M125236</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-24T14:41:09Z</dc:date>
    </item>
  </channel>
</rss>

