<?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: Rex Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185890#M53566</link>
    <description>&lt;P&gt;Please post a sample of your data.&lt;/P&gt;</description>
    <pubDate>Fri, 24 Oct 2014 18:26:55 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2014-10-24T18:26:55Z</dc:date>
    <item>
      <title>Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185889#M53565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Does anyone know what i need to put in between these two fields in order to make the query continue on the ip2 if ip1 is found on a single log event?  Sometimes there may &lt;STRONG&gt;not&lt;/STRONG&gt; be an ip2...   \s+ is what i have  currently.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "(?i)(?&amp;lt;ip1&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+(?&amp;lt;ip2&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:25:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185889#M53565</guid>
      <dc:creator>ho000dor</dc:creator>
      <dc:date>2014-10-24T18:25:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185890#M53566</link>
      <description>&lt;P&gt;Please post a sample of your data.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185890#M53566</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-24T18:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185891#M53567</link>
      <description>&lt;P&gt;hodor           &lt;/P&gt;

&lt;P&gt;also sample data.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:41:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185891#M53567</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2014-10-24T18:41:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185892#M53568</link>
      <description>&lt;P&gt;It could vary.  &lt;/P&gt;

&lt;P&gt;Anything from:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;192.168.1.1 4.2.2.2 blah blah other stuff 

or 

otherstuff 192.168.1.1 blah blah

or 

otherstuff blah blah 192.168.1.1 blah blah 4.2.2.2 otherstuff
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ip2 &lt;STRONG&gt;can&lt;/STRONG&gt; be null if there isn't a second IP.  Is that possible or do i have to set up a second | rex?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185892#M53568</guid>
      <dc:creator>ho000dor</dc:creator>
      <dc:date>2014-10-24T18:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185893#M53569</link>
      <description>&lt;P&gt;have you tried this rex max_match=2 field=_raw " (?i)(?\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})*" with max_match parameter set to 2 as mentioned in this &lt;A href="http://answers.splunk.com/answers/47381/how-to-extract-all-matching-values-from-an-event-using-regex.html" target="_blank"&gt;http://answers.splunk.com/answers/47381/how-to-extract-all-matching-values-from-an-event-using-regex.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:57:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185893#M53569</guid>
      <dc:creator>sk314</dc:creator>
      <dc:date>2020-09-28T17:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185894#M53570</link>
      <description>&lt;P&gt;Try this (run anywhere sample, before rex part is to generate sample data)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|gentimes start=-1 | eval temp="192.168.1.1 4.2.2.2 blah blah other stuff #otherstuff 192.168.1.1 blah blah#otherstuff blah blah 192.168.1.1 blah blah 4.2.2.2 otherstuff" | table temp | makemv temp delim="#" | mvexpand temp | rename temp as _raw 
| rex "(?i)(?&amp;lt;ip1&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(.*(?&amp;lt;ip2&amp;gt;(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))|.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Oct 2014 19:29:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185894#M53570</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-24T19:29:02Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185895#M53571</link>
      <description>&lt;P&gt;That's exactly what i'm looking for! Thanks a lot!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 19:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185895#M53571</guid>
      <dc:creator>ho000dor</dc:creator>
      <dc:date>2014-10-24T19:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185896#M53572</link>
      <description>&lt;P&gt;Thanks a lot! &lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 19:32:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185896#M53572</guid>
      <dc:creator>ho000dor</dc:creator>
      <dc:date>2014-10-24T19:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: Rex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185897#M53573</link>
      <description>&lt;P&gt;It'd be nice for future generations to accept the answer that solved the problem instead. Then others can immediately see the solution if they have similar questions rather than guessing what's the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 20:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-Question/m-p/185897#M53573</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-24T20:03:08Z</dc:date>
    </item>
  </channel>
</rss>

