<?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: Proper REX command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99685#M25705</link>
    <description>&lt;P&gt;If you don't want to include the string matched by &lt;CODE&gt;\s:\s&lt;/CODE&gt;, just leave it out of the matching group.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2013 18:41:33 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2013-07-18T18:41:33Z</dc:date>
    <item>
      <title>Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99678#M25698</link>
      <description>&lt;P&gt;What would the proper REX command be to extract the following:&lt;/P&gt;

&lt;P&gt;SPACE:SPACE then a numeric string&lt;/P&gt;

&lt;P&gt;so ends up being ' : 949495'&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 13:55:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99678#M25698</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T13:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99679#M25699</link>
      <description>&lt;P&gt;Any regex tutorial would have the regex. This one only extracts the digits.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;your_search | rex field=_raw "\s:\s(?&amp;lt;extracted&amp;gt;\d+)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 14:21:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99679#M25699</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-18T14:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99680#M25700</link>
      <description>&lt;P&gt;Putting the "\s:\s" into the capture string will include it all -- if that is what you are wanting. This is how I am reading your desired results, else what alacercogitatus provided is right on target.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 14:26:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99680#M25700</guid>
      <dc:creator>rgcurry</dc:creator>
      <dc:date>2013-07-18T14:26:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99681#M25701</link>
      <description>&lt;P&gt;Yes all of it is what I want, I need to make one more clarification is that when its present its ALWAYS at the END of the line. Its the last string. The rex above is pulling data out in the middle of the line as well which is not desired.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 15:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99681#M25701</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T15:36:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99682#M25702</link>
      <description>&lt;P&gt;&lt;CODE&gt;your_search | rex field=_raw "(?&amp;lt;extracted&amp;gt;\s:\s\d+)$"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 15:48:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99682#M25702</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-18T15:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99683#M25703</link>
      <description>&lt;P&gt;Thats producing a field with the decimal included...&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 16:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99683#M25703</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T16:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99684#M25704</link>
      <description>&lt;P&gt;Which decimal?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 18:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99684#M25704</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-18T18:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99685#M25705</link>
      <description>&lt;P&gt;If you don't want to include the string matched by &lt;CODE&gt;\s:\s&lt;/CODE&gt;, just leave it out of the matching group.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 18:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99685#M25705</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-18T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99686#M25706</link>
      <description>&lt;P&gt;Not sure how to do that and ensure it still matches on ' : 949495'&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99686#M25706</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99687#M25707</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Let me know how following works for you.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex "(?i)(?P&amp;lt;var&amp;gt; : [0-9]+)$"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Saxena&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99687#M25707</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T19:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99688#M25708</link>
      <description>&lt;P&gt;It's basically what's in alacer's initial answer but you add the &lt;CODE&gt;$&lt;/CODE&gt; at the end. You may not know regex but reading through the answers and comments should give you some idea anyway.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99688#M25708</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-18T19:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99689#M25709</link>
      <description>&lt;P&gt;Error in 'rex' command: Encountered the following error while compiling the regex '(?i)(?P : [0-9]+)$': Regex: unrecognized character after (?P&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:40:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99689#M25709</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T19:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99690#M25710</link>
      <description>&lt;P&gt;Oh ! That was a typo from my side. Try the following and let me know the outcome.&lt;/P&gt;

&lt;P&gt;rex "(?i)(?P&lt;VAR&gt; : [0-9]+)$"&lt;/VAR&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:42:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99690#M25710</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T19:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99691#M25711</link>
      <description>&lt;P&gt;Wait ! no matter I put correct answer, some characters are getting truncated when I submit the post ! I am posting the answer again in "post your answer" section.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:43:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99691#M25711</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T19:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99692#M25712</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Try the following regular expression.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex "(?i)(?P&amp;lt;var&amp;gt; : [0-9]+)$"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Note : Please add "&amp;lt; var &amp;gt;" ( without spaces and quotes ) after "?P" in the regular expression. Due to some issue, the "&amp;lt;" and "&amp;gt;" characters are getting truncated from my post.&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Saxena&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:49:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99692#M25712</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T19:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99693#M25713</link>
      <description>&lt;P&gt;A better sample of data would help with the regex.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 19:59:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99693#M25713</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-18T19:59:22Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99694#M25714</link>
      <description>&lt;P&gt;Let me know if this works.&lt;/P&gt;

&lt;P&gt;rex "(?i)(?P&lt;VAR&gt; : [0-9]+)$"&lt;/VAR&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 20:05:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99694#M25714</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T20:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99695#M25715</link>
      <description>&lt;P&gt;Still the characters in my post are getting truncated and I don't know why &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 20:06:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99695#M25715</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-18T20:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99696#M25716</link>
      <description>&lt;P&gt;can you put it in a code block?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 20:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99696#M25716</guid>
      <dc:creator>tb5821</dc:creator>
      <dc:date>2013-07-18T20:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Proper REX command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99697#M25717</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Putting the expression inside a code block.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rex "(?i)(?P&amp;lt;var&amp;gt; : [0-9]+)$"&lt;/CODE&gt;l&lt;/P&gt;

&lt;P&gt;Hopefully this time, there are no characters that gets truncated&lt;/P&gt;

&lt;P&gt;Let me know if it works for you&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Amit Saxena&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2013 06:45:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Proper-REX-command/m-p/99697#M25717</guid>
      <dc:creator>amit_saxena</dc:creator>
      <dc:date>2013-07-19T06:45:45Z</dc:date>
    </item>
  </channel>
</rss>

