<?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 2 different values from a string and put it into 2 fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222844#M188219</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;your search | rex field=_raw "(?&amp;lt;first&amp;gt;\w)\sis\s(?&amp;lt;status&amp;gt;\w+)" | table first status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;first column will have only one letter (a or b or .. ) or it can have a few letters (host1, etc )&lt;BR /&gt;
status will have only "running" or what other values it can have (running, not running, failed, etc..)&lt;/P&gt;</description>
    <pubDate>Thu, 11 Aug 2016 12:16:06 GMT</pubDate>
    <dc:creator>inventsekar</dc:creator>
    <dc:date>2016-08-11T12:16:06Z</dc:date>
    <item>
      <title>how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222843#M188218</link>
      <description>&lt;H2&gt;My data looks like:&lt;/H2&gt;

&lt;P&gt;A is running&lt;BR /&gt;
b is running&lt;/P&gt;

&lt;H2&gt;c is running&lt;/H2&gt;

&lt;P&gt;each events contain such kind of bunch of data. i want to create 2 fields capturing (A,B,C) in row and other capturing the corresponding status(running) in row.&lt;/P&gt;

&lt;P&gt;please provide me needful help&lt;/P&gt;

&lt;P&gt;thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 07:44:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222843#M188218</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T07:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222844#M188219</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;your search | rex field=_raw "(?&amp;lt;first&amp;gt;\w)\sis\s(?&amp;lt;status&amp;gt;\w+)" | table first status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;first column will have only one letter (a or b or .. ) or it can have a few letters (host1, etc )&lt;BR /&gt;
status will have only "running" or what other values it can have (running, not running, failed, etc..)&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222844#M188219</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-11T12:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222845#M188220</link>
      <description>&lt;P&gt;there is no value under the table first status i.e not able to see any output&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:24:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222845#M188220</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T12:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222846#M188221</link>
      <description>&lt;P&gt;the "status" is the variable i am using the extract the word "running".&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:37:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222846#M188221</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-11T12:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222847#M188222</link>
      <description>&lt;P&gt;so under the field name "status" running value should be populated but the table is blank. just one row is there having name which is captured under &amp;lt;&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222847#M188222</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T12:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222848#M188223</link>
      <description>&lt;P&gt;i uploaded these sample events - &lt;BR /&gt;
A is running&lt;BR /&gt;
b is running&lt;BR /&gt;
c is running&lt;BR /&gt;
A is running&lt;BR /&gt;
b is failed&lt;BR /&gt;
c is running&lt;/P&gt;

&lt;P&gt;i ran this query - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=runningrex | rex field=_raw "(?&amp;lt;first&amp;gt;\w)\sis\s(?&amp;lt;status&amp;gt;\w+)" | table first status _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and i get this result - &lt;/P&gt;

&lt;P&gt;first   status  _raw&lt;BR /&gt;
c      running      c is running&lt;BR /&gt;
b      failed                b is failed&lt;BR /&gt;
A      running      A is running&lt;BR /&gt;
c      running      c is running&lt;BR /&gt;
b      running      b is running&lt;BR /&gt;
A      running      A is running&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:50:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222848#M188223</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2016-08-11T12:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222849#M188224</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=_raw "(?&amp;lt;first&amp;gt;\w+)\sis\s(?&amp;lt;status&amp;gt;\w+)" | table first status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:55:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222849#M188224</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-11T12:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222850#M188225</link>
      <description>&lt;P&gt;none of the solution give the desire output. all output are blank. &lt;/P&gt;

&lt;P&gt;Splunk version 6.2.5 i am using, could this cause any problem&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 12:59:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222850#M188225</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222851#M188226</link>
      <description>&lt;P&gt;Assuming these are individual events, try this.&lt;/P&gt;

&lt;P&gt;*&lt;STRONG&gt;&lt;EM&gt;UPDATED based on real events&lt;/EM&gt;&lt;/STRONG&gt;*&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search | rex field=_raw "(?&amp;lt;device&amp;gt;[^\(]+)\(\d+\)\sis\s(?&amp;lt;status&amp;gt;\w+)" | table device status
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 13:07:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222851#M188226</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-11T13:07:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222852#M188227</link>
      <description>&lt;P&gt;Is this what you are trying to achieve?&lt;BR /&gt;
Feel free to copy and paste into your search box or simply get rid of everything up to the rex and use the right name of your field there to try this out.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | fields - _time
| eval sample = "
A is running;
b is running;
c is running;
D is stopped;
E is unreachable
"
| eval sample = split(sample, ";")
| mvexpand sample
| rex field=sample "(?&amp;lt;who&amp;gt;\w+).+?(?&amp;lt;status&amp;gt;\w+)$"
| table who, status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output (see picture below):&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1709i44B8D37D486740F1/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 14:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222852#M188227</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-08-11T14:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222853#M188228</link>
      <description>&lt;P&gt;actual data is like in place of&lt;BR /&gt;
A is running;&lt;BR /&gt;
 b is running;&lt;BR /&gt;
 c is running;&lt;BR /&gt;
 D is stopped;&lt;BR /&gt;
 E is unreachable&lt;/P&gt;

&lt;P&gt;is&lt;BR /&gt;
 'aaaa bbbb cccc dddd'  (1234) is running.&lt;BR /&gt;
'akdg ytdf tyui tyhj'  (1245) is running.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.like this&lt;BR /&gt;
so i have to capture only:-  aaaa bbbb cccc dddd  running in two different field. similary other values.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 19:40:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222853#M188228</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T19:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222854#M188229</link>
      <description>&lt;P&gt;@Tannawi.Chauhan try my updated answer&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 19:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222854#M188229</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-11T19:45:38Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222855#M188230</link>
      <description>&lt;P&gt;didn't work......:(&lt;BR /&gt;
I think rex pattern is causing problem.&lt;BR /&gt;
My data is like&lt;BR /&gt;
'aaaa bbbb cccc dddd' (1234) is running.&lt;BR /&gt;
'akdg ytdf tyui tyhj' (1245) is running.&lt;/P&gt;

&lt;P&gt;so output should be in two different field&lt;BR /&gt;
aaaa bbbb cccc dddd         running&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 19:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222855#M188230</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T19:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222856#M188231</link>
      <description>&lt;P&gt;See if you see the right values in the right panel  in this site&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/mJ8iX9/1"&gt;https://regex101.com/r/mJ8iX9/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 19:56:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222856#M188231</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-08-11T19:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222857#M188232</link>
      <description>&lt;P&gt;didn't work&lt;/P&gt;</description>
      <pubDate>Thu, 11 Aug 2016 20:25:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222857#M188232</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-11T20:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222858#M188233</link>
      <description>&lt;P&gt;Then simply change the regex to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\'(?&amp;lt;who&amp;gt;[^\']+)\'.+?(?&amp;lt;status&amp;gt;\w+)$"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 Aug 2016 21:17:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222858#M188233</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-08-11T21:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222859#M188234</link>
      <description>&lt;P&gt;none of the solution work out....:(&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 07:16:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222859#M188234</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-12T07:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222860#M188235</link>
      <description>&lt;P&gt;Can you post the query here?&lt;/P&gt;

&lt;P&gt;This works fine for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | fields - _time
| eval sample = "
'aaaa bbbb cccc dddd' (1234) is running;
'akdg ytdf tyui tyhj' (1245) is running
"
| eval sample = split(sample, ";")
| mvexpand sample
| rex field=sample "\'(?&amp;lt;who&amp;gt;[^\']+)\'.+?(?&amp;lt;status&amp;gt;\w+)$"
| table who, status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Output:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="https://s10.postimg.org/cr924bypl/Screen_Shot_2016_08_12_at_11_34_49.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 10:34:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222860#M188235</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-08-12T10:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222861#M188236</link>
      <description>&lt;P&gt;may i know which version of splunk you are using.....&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 11:14:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222861#M188236</guid>
      <dc:creator>Tannawi_Chauha1</dc:creator>
      <dc:date>2016-08-12T11:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to extract 2 different values from a string and put it into 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222862#M188237</link>
      <description>&lt;P&gt;Splunk Enterprise 6.4.1&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 11:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-extract-2-different-values-from-a-string-and-put-it-into/m-p/222862#M188237</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2016-08-12T11:57:40Z</dc:date>
    </item>
  </channel>
</rss>

