<?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: REGEX match on multiple conditions help in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105664#M27407</link>
    <description>&lt;P&gt;"?" changes the "+" from greedy to lazy.  Lazy means match as few as possible.  Greedy means match as many as possible.&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2015 12:26:58 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2015-07-17T12:26:58Z</dc:date>
    <item>
      <title>REGEX match on multiple conditions help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105660#M27403</link>
      <description>&lt;P&gt;I need help with a REGEX that needs to match multiple conditions in a log event.&lt;/P&gt;

&lt;P&gt;The event looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;02:02:02.000 AM 
Mar 30 02:02:02 servername1 Oracle Audit[2225]: SESSIONID: "123456789" ENTRYID: "*****" USERID: "ABC" USERHOST: "server2"  OBJ$CREATOR: "LMN" OBJ$NAME: "value1" SES$ACTIONS: "--**********-" OS$USERID: "someusername" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to send events to the nullQueue when &lt;STRONG&gt;all of the&lt;/STRONG&gt; following conditions are met:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;USERHOST: "server2"&lt;/LI&gt;
&lt;LI&gt;OS$USERID: "someusername" &lt;/LI&gt;
&lt;LI&gt;USERID: "ABC"&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;This is the REGEX that I have in place, but doesn't seem to be working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (?s)(OS\$USERID:\s.someusername.).+?(USERHOST:\s.server2.).+?(USERID:\s.ABC.)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any ideas on how to correct my failing regex?&lt;BR /&gt;
THanks&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2012 15:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105660#M27403</guid>
      <dc:creator>roguepacket</dc:creator>
      <dc:date>2012-03-30T15:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX match on multiple conditions help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105661#M27404</link>
      <description>&lt;P&gt;Well since you put the "OS$USERID" match first of all in regex, but it's the last part of the event you're matching against, the whole regex will fail. You need to put the matching groups in the correct order. In your event, USERID comes first, followed by USERHOST and OS$USERID. So, something like this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (?s)(USERID:\s.ABC.).+?(USERHOST:\s.server2.).+?(OS\$USERID:\s.someusername.)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Mar 2012 16:07:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105661#M27404</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-03-30T16:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX match on multiple conditions help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105662#M27405</link>
      <description>&lt;P&gt;Worked perfectly!  Thanks for your quick answer!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Mar 2012 17:01:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105662#M27405</guid>
      <dc:creator>roguepacket</dc:creator>
      <dc:date>2012-03-30T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX match on multiple conditions help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105663#M27406</link>
      <description>&lt;P&gt;What is the purpose of (?s)&lt;/P&gt;

&lt;P&gt;The regex did not work for me when I used it.  Works fine without it (for me).&lt;/P&gt;</description>
      <pubDate>Tue, 14 Oct 2014 18:15:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105663#M27406</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2014-10-14T18:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: REGEX match on multiple conditions help</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105664#M27407</link>
      <description>&lt;P&gt;"?" changes the "+" from greedy to lazy.  Lazy means match as few as possible.  Greedy means match as many as possible.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 12:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REGEX-match-on-multiple-conditions-help/m-p/105664#M27407</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-07-17T12:26:58Z</dc:date>
    </item>
  </channel>
</rss>

