<?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: Problem with rex not doing anything at all, not even in its simplest form! in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187259#M53957</link>
    <description>&lt;P&gt;Try with this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=move1 "^(?&amp;lt;mytest&amp;gt;\w+$)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 13 Mar 2014 23:32:13 GMT</pubDate>
    <dc:creator>krish3</dc:creator>
    <dc:date>2014-03-13T23:32:13Z</dc:date>
    <item>
      <title>Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187258#M53956</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I am trying to extract the string after the first space, so for ex. I need to extract:&lt;BR /&gt;
"02-main-menu" for the first record and "02-world" for the second record below.  However, since I can't get the rex work, I thought I just test rex with a simplest format and see what it does, adn sure enough, it seems it doesn't do anything!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup bwCustomerTransMovesByFlow_20130213-15.csv | fields move1 | eval c=mvcount(move1) | rex field=move1 "(?&amp;lt;mytest&amp;gt;)"  
_time                           move1                   c   mytest
2/13/14 5:34:04.000 AM      01-ios 02-main-menu 1       
2/13/14 12:51:13.000 AM         01-ios 02-world         1   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just to be sure that the field move1 is not being a multivalue Idid the mvcount(move1) and it returns 1 for all. I also tried doing "nomv move1" which did not make any difference.&lt;BR /&gt;
The data in the inputlookup is generated as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....|  | transaction CUSTOMER_KEY  connected=t mvlist=t  keepevicted=t keeporphans=t  |   eval move1=mvindex(this_move2,0,1) | .... | makemv delim="," move1 |..... | sort 0 CUSTOMER_KEY | outputlookup bwCustomerTransMovesByFlow_20130213-15.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;btw, I forgot to take out "makemv delim="," move1", but it didn't do anything anyway I think becasue it did ot insert "," anywhere. Besides, nomv supposedly should undo it.&lt;/P&gt;

&lt;P&gt;Apreciate a quick repsonse.  I am stuck!&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 22:49:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187258#M53956</guid>
      <dc:creator>fere</dc:creator>
      <dc:date>2014-03-13T22:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187259#M53957</link>
      <description>&lt;P&gt;Try with this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=move1 "^(?&amp;lt;mytest&amp;gt;\w+$)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Mar 2014 23:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187259#M53957</guid>
      <dc:creator>krish3</dc:creator>
      <dc:date>2014-03-13T23:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187260#M53958</link>
      <description>&lt;P&gt;it doesn't work.  it returns null for mytest.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 05:54:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187260#M53958</guid>
      <dc:creator>fere</dc:creator>
      <dc:date>2014-03-14T05:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187261#M53959</link>
      <description>&lt;P&gt;Your rex doesn't do anything because you're not telling it to do anything. When you do &lt;CODE&gt;rex field=move1 "(?&amp;lt;mytest&amp;gt;)"&lt;/CODE&gt; you're not including anything to capture in your matching group, and so nothing will be captured either.&lt;/P&gt;

&lt;P&gt;The simplest form to try out would be a matching group with &lt;CODE&gt;.+&lt;/CODE&gt; ("read all characters from input", more or less), so in your case you would do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=move1 "(?&amp;lt;mytest&amp;gt;.+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Mar 2014 06:02:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187261#M53959</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-03-14T06:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187262#M53960</link>
      <description>&lt;P&gt;It works.   Many thanks for your quick response.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 07:01:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187262#M53960</guid>
      <dc:creator>fere</dc:creator>
      <dc:date>2014-03-14T07:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with rex not doing anything at all, not even in its simplest form!</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187263#M53961</link>
      <description>&lt;P&gt;Isn't . (dot) mean any character except new line? When I use the above regex for&lt;BR /&gt;
 move1="01-ios 02-main-menu" &lt;BR /&gt;
it returns "01-ios" for mytest.  How does it know that it should stop at the space?&lt;BR /&gt;&lt;BR /&gt;
I am trying to come up with the regex that would actually return the part after the last white space (in this ex. "02-main-menu".&lt;BR /&gt;
Appreciate your help.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Mar 2014 08:09:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-rex-not-doing-anything-at-all-not-even-in-its/m-p/187263#M53961</guid>
      <dc:creator>fere</dc:creator>
      <dc:date>2014-03-14T08:09:51Z</dc:date>
    </item>
  </channel>
</rss>

