<?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 values from a String. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304888#M160189</link>
    <description>&lt;P&gt;I am not at all clear about what you are trying to do but I have updated my answer with a mockup of 3 different guesses all in one search.  One of them should be like what you are trying to do.  See the updated answer.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jul 2017 03:57:11 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-07-15T03:57:11Z</dc:date>
    <item>
      <title>How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304882#M160183</link>
      <description>&lt;P&gt;Hi i have values in a column like AA(15), ABC(20), ADSF(90).Now i need a regular expression which gives me only values before the Bracket"(".&lt;BR /&gt;
so i should get  AA,ABC,ADSF as my output.&lt;BR /&gt;
Please help.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 09:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304882#M160183</guid>
      <dc:creator>prafulljha</dc:creator>
      <dc:date>2017-07-12T09:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304883#M160184</link>
      <description>&lt;P&gt;Try this.. It will extract out only the AA, ABC, ADSF.. This will create the a field called &lt;CODE&gt;FIELD_NAME&lt;/CODE&gt;.. You can change it to whatever name you want&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(?&amp;lt;FIELD_NAME&amp;gt;\w+)\(\d+\)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 13:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304883#M160184</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2017-07-12T13:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304884#M160185</link>
      <description>&lt;P&gt;If you want to get rid of the parentheses and the numeric values in them, use something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=_raw mode=sed "s/\(\d*\)//g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to do a single field, use the fieldname instead of _raw. The value will be returned without the parenthesis and numbers, leaving the values you want.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jul 2017 15:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304884#M160185</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-07-12T15:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304885#M160186</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Track="ATL(27)" 
| eval 'ATL(27)'=Track 
| rex field="Track" mode=sed "s/\([^)]*\)//" 
| rex field='ATL(27)' mode=sed "s/\([^)]*\)//"
| eval "ATLcopy(27)" = Track
| foreach "*copy(*)" [ rename &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; AS "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;copy" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Jul 2017 02:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304885#M160186</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-13T02:17:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304886#M160187</link>
      <description>&lt;P&gt;Hi Woodcock,&lt;/P&gt;

&lt;P&gt;Can you please let me know what i am doing wrong here.&lt;BR /&gt;
Basically i want the string value to print when i use it in Table funciton:&lt;BR /&gt;
So the output should be "AA" when i pass "AA(27)" as input.&lt;BR /&gt;
Here is my query:&lt;BR /&gt;
source="ABC" sourcetype="csv"|where Level="Lvl3" and Track="ATL(27)"|rex field="ATL(27)" mode=sed "s/([^)]*)//"|table "Dom","field"&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2017 10:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304886#M160187</guid>
      <dc:creator>prafulljha</dc:creator>
      <dc:date>2017-07-14T10:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304887#M160188</link>
      <description>&lt;P&gt;try something like this, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="ABC" sourcetype="csv"|where Level="Lvl3" AND Track="ATL(27)"|rex field=Track mode=sed "s/([^)]*)//"|table "Dom", Track Level 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Jul 2017 18:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304887#M160188</guid>
      <dc:creator>vasanthmss</dc:creator>
      <dc:date>2017-07-14T18:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304888#M160189</link>
      <description>&lt;P&gt;I am not at all clear about what you are trying to do but I have updated my answer with a mockup of 3 different guesses all in one search.  One of them should be like what you are trying to do.  See the updated answer.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jul 2017 03:57:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304888#M160189</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-15T03:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304889#M160190</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/*source*/ | eval new=replace(Track,"\([0-9]*\)","")| table Track,new
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2017 06:21:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304889#M160190</guid>
      <dc:creator>dsiob</dc:creator>
      <dc:date>2017-07-17T06:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304890#M160191</link>
      <description>&lt;P&gt;Hi dsiob,&lt;/P&gt;

&lt;P&gt;Thanks, it's working fine.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 06:36:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304890#M160191</guid>
      <dc:creator>pjhae</dc:creator>
      <dc:date>2017-07-17T06:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract values from a String.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304891#M160192</link>
      <description>&lt;P&gt;OK, so go back and &lt;CODE&gt;UpVote&lt;/CODE&gt; and helpful/correct answer and click &lt;CODE&gt;Accept&lt;/CODE&gt; on the correctest one.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2017 14:24:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-values-from-a-String/m-p/304891#M160192</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-17T14:24:28Z</dc:date>
    </item>
  </channel>
</rss>

