<?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: Extract string within specific tag in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450023#M127432</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults  |eval tag="&amp;lt;Val Ty=\"CHAR\"&amp;gt;Feedback&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty=\"CHAR\"&amp;gt;3&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty=\"CHAR\"&amp;gt;TRST&amp;lt;/Val&amp;gt;" |rex field=tag "CHAR\"\&amp;gt;(?P&amp;lt;output&amp;gt;(\d+))\&amp;lt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval tag="&amp;lt;Val Ty=\"CHAR\"&amp;gt;Feedback&amp;lt;/Val&amp;gt;
 &amp;lt;Val Ty=\"CHAR\"&amp;gt;3&amp;lt;/Val&amp;gt;
 &amp;lt;Val Ty=\"CHAR\"&amp;gt;TRST&amp;lt;/Val&amp;gt;" 
| rex field=tag max_match=0 "\"CHAR\"&amp;gt;(?P&amp;lt;output&amp;gt;.+)&amp;lt;" 
| eval result = mvindex(output,1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Mar 2019 04:25:06 GMT</pubDate>
    <dc:creator>vnravikumar</dc:creator>
    <dc:date>2019-03-20T04:25:06Z</dc:date>
    <item>
      <title>Extract string within specific tag</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450022#M127431</link>
      <description>&lt;P&gt;Hello Experts ,&lt;BR /&gt;
Need your assistance to extract output from one of the below XML tags.&lt;BR /&gt;
I have three XML tags with same naming convention and I want only extract specific value 3 from the below tags. &lt;BR /&gt;
can you help me to provide rex commend (or) any other commend which will only extract value 3 from the below tags.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Val Ty="CHAR"&amp;gt;Feedback&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty="CHAR"&amp;gt;3&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty="CHAR"&amp;gt;TRST&amp;lt;/Val&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;your help is much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 04:15:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450022#M127431</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-03-20T04:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string within specific tag</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450023#M127432</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults  |eval tag="&amp;lt;Val Ty=\"CHAR\"&amp;gt;Feedback&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty=\"CHAR\"&amp;gt;3&amp;lt;/Val&amp;gt;
&amp;lt;Val Ty=\"CHAR\"&amp;gt;TRST&amp;lt;/Val&amp;gt;" |rex field=tag "CHAR\"\&amp;gt;(?P&amp;lt;output&amp;gt;(\d+))\&amp;lt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval tag="&amp;lt;Val Ty=\"CHAR\"&amp;gt;Feedback&amp;lt;/Val&amp;gt;
 &amp;lt;Val Ty=\"CHAR\"&amp;gt;3&amp;lt;/Val&amp;gt;
 &amp;lt;Val Ty=\"CHAR\"&amp;gt;TRST&amp;lt;/Val&amp;gt;" 
| rex field=tag max_match=0 "\"CHAR\"&amp;gt;(?P&amp;lt;output&amp;gt;.+)&amp;lt;" 
| eval result = mvindex(output,1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Mar 2019 04:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450023#M127432</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-20T04:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Extract string within specific tag</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450024#M127433</link>
      <description>&lt;P&gt;Thanks @vnravikumar , below solution works. &lt;BR /&gt;
Second solution didnt give me desired results.&lt;/P&gt;

&lt;P&gt;|makeresults  |eval tag="Feedback&lt;BR /&gt;
 3&lt;BR /&gt;
 TRST" |rex field=tag "CHAR\"&amp;gt;(?P(\d+))&amp;lt;"&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 06:23:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-string-within-specific-tag/m-p/450024#M127433</guid>
      <dc:creator>kirangurram</dc:creator>
      <dc:date>2019-03-20T06:23:09Z</dc:date>
    </item>
  </channel>
</rss>

