<?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: Can't get rex to work in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128669#M34938</link>
    <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Rex"&gt;REX Documentation&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2015 19:02:19 GMT</pubDate>
    <dc:creator>dflodstrom</dc:creator>
    <dc:date>2015-07-17T19:02:19Z</dc:date>
    <item>
      <title>Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128663#M34932</link>
      <description>&lt;P&gt;I have been searching Splunk answers and read the documentation and not sure it is something simple I am missing. but rex using field=_raw does not seem to filter any results. For instance, whether I run a search with 'asterisk'  or with * |  rex field=_raw "src inside (?&amp;lt;src&amp;gt;\d+.\d+.\d+.\d+\/\d+)"' the results are always the same. And this happens with every rex command I run. Can someone please point me in the right direction? Another example I can not get to work is below:&lt;/P&gt;

&lt;P&gt;'* |  rex field=_raw "src inside (?&amp;lt;src&amp;gt;\d+.\d+.\d+.\d+\/\d+)"'&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 06:44:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128663#M34932</guid>
      <dc:creator>ride76</dc:creator>
      <dc:date>2020-09-29T06:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128664#M34933</link>
      <description>&lt;P&gt;If your syntax is exactly as you've shown it you might not be matching 'digits' because you're using &lt;CODE&gt;'d'&lt;/CODE&gt; and not &lt;CODE&gt;'\d'&lt;/CODE&gt;.  Don't forget to escape special characters like '/' ... you might need &lt;CODE&gt;'\/'&lt;/CODE&gt; there.&lt;/P&gt;

&lt;P&gt;If the information you're trying to capture is something like 123.45.67.8/24 try:  &lt;CODE&gt;| rex "src\sinside\s(?\d+\.\d+\.\d+\.\d+\/\d+)"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;-edited because splunk answers needs special characters escaped too.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:40:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128664#M34933</guid>
      <dc:creator>dflodstrom</dc:creator>
      <dc:date>2015-07-17T18:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128665#M34934</link>
      <description>&lt;P&gt;You are using strange terminology.  The &lt;CODE&gt;rex&lt;/CODE&gt; command does NOT &lt;CODE&gt;filter&lt;/CODE&gt; but the &lt;CODE&gt;regex&lt;/CODE&gt; command does.   The &lt;CODE&gt;rex&lt;/CODE&gt; command creates new fields using existing fields.  Are you trying to "filter" or create fields?  Assuming the latter, this might work for you:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "src\s*inside\s*(?&amp;lt;src&amp;gt;\d+\.\d+\.\d+\.\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:41:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128665#M34934</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-17T18:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128666#M34935</link>
      <description>&lt;P&gt;The link where I initially started reading is &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Rex&lt;/A&gt;. Another link is &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Regex"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.4/SearchReference/Regex&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;I am trying to filter on IP's in the format x.x.x.x/port#. Another query I am trying is rex field=_raw "http://(?[^:]&lt;EM&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/EM&gt;".&lt;/P&gt;

&lt;P&gt;And of course the last query is not showing up correctly b/c the forum will not let me post tags. After the question mark there is supposed to be a field name. Rex-_raw is not working either.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 18:54:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128666#M34935</guid>
      <dc:creator>ride76</dc:creator>
      <dc:date>2015-07-17T18:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128667#M34936</link>
      <description>&lt;P&gt;Highlight your 'code' and click the little binary looking 'code sample' button above the text input box and we'll see everything you type.&lt;/P&gt;

&lt;P&gt;Woodcock makes a good point, you're saying "filter".  REX doesn't filter, it captures the characters that match your pattern and assigns them to the field you specified/created.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128667#M34936</guid>
      <dc:creator>dflodstrom</dc:creator>
      <dc:date>2015-07-17T19:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128668#M34937</link>
      <description>&lt;P&gt;Based on this clarification in which you used "FILTER":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;I am trying to filter on IP's in the format x.x.x.x/port#. Another query I am trying is rex field=_raw "http://(?[^:]*):*".
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | regex _raw="src\s*inside\s*\d+\.\d+\.\d+\.\d+/\d+"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will throw away any events that do not match this RegEx (filtering in).  If you need to filter out, use &lt;CODE&gt;!=&lt;/CODE&gt; instead of &lt;CODE&gt;=&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:01:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128668#M34937</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-17T19:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128669#M34938</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.3/SearchReference/Rex"&gt;REX Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:02:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128669#M34938</guid>
      <dc:creator>dflodstrom</dc:creator>
      <dc:date>2015-07-17T19:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128670#M34939</link>
      <description>&lt;P&gt;There are backslashes after each 'd' and '.' - - the forum was removing when I tried to post but I just figured out how to post code. Also, I have tried running with rex and regex. Both samples are below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "(?&amp;lt;src&amp;gt;)\d+\.\d+\.\d+\.\d+(?&amp;lt;src_port&amp;gt;)\/\d+"

rex field=_raw "http://(?&amp;lt;Dest&amp;gt;[^:]*):*"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128670#M34939</guid>
      <dc:creator>ride76</dc:creator>
      <dc:date>2015-07-17T19:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rex to work</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128671#M34940</link>
      <description>&lt;P&gt;It might be time to rephrase your question.  I don't think your desired outcome is clear.  Provide some sample events for better help.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 19:13:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-t-get-rex-to-work/m-p/128671#M34940</guid>
      <dc:creator>dflodstrom</dc:creator>
      <dc:date>2015-07-17T19:13:30Z</dc:date>
    </item>
  </channel>
</rss>

