<?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 RegEx  AND / OR? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26734#M5177</link>
    <description>&lt;P&gt;I am trying to extract an IP address into a field, however the same information occurs on two different logs, with two different logging methods. &lt;/P&gt;

&lt;P&gt;I am attempting to extract the field with just one RegEx statement, but I can't seem to get the "AND" or "OR" portion of RegEx to recognize both data sets.  &lt;/P&gt;

&lt;P&gt;This is what I have:&lt;BR /&gt;
src\s-\s(?&lt;EXT_IP&gt;\d+.\d+.\d+.\d+) OR DENIED\s-\s(?&lt;EXT_IP&gt;\d+.\d+.\d+.\d+)&lt;/EXT_IP&gt;&lt;/EXT_IP&gt;&lt;/P&gt;

&lt;P&gt;I am attempting to extract the external IP address, from two different devices with 1 RegEx statement and put either 'hit' into the field "ext_ip". &lt;/P&gt;

&lt;P&gt;here are the two message types:&lt;BR /&gt;
DENIED - 10.10.10.10:8080 | &lt;BR /&gt;
src - 10.10.10.10:8080&lt;/P&gt;

&lt;P&gt;Does anyone know of a way to do this? &lt;/P&gt;</description>
    <pubDate>Wed, 07 Nov 2012 17:02:21 GMT</pubDate>
    <dc:creator>tmarlette</dc:creator>
    <dc:date>2012-11-07T17:02:21Z</dc:date>
    <item>
      <title>RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26734#M5177</link>
      <description>&lt;P&gt;I am trying to extract an IP address into a field, however the same information occurs on two different logs, with two different logging methods. &lt;/P&gt;

&lt;P&gt;I am attempting to extract the field with just one RegEx statement, but I can't seem to get the "AND" or "OR" portion of RegEx to recognize both data sets.  &lt;/P&gt;

&lt;P&gt;This is what I have:&lt;BR /&gt;
src\s-\s(?&lt;EXT_IP&gt;\d+.\d+.\d+.\d+) OR DENIED\s-\s(?&lt;EXT_IP&gt;\d+.\d+.\d+.\d+)&lt;/EXT_IP&gt;&lt;/EXT_IP&gt;&lt;/P&gt;

&lt;P&gt;I am attempting to extract the external IP address, from two different devices with 1 RegEx statement and put either 'hit' into the field "ext_ip". &lt;/P&gt;

&lt;P&gt;here are the two message types:&lt;BR /&gt;
DENIED - 10.10.10.10:8080 | &lt;BR /&gt;
src - 10.10.10.10:8080&lt;/P&gt;

&lt;P&gt;Does anyone know of a way to do this? &lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 17:02:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26734#M5177</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-11-07T17:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26735#M5178</link>
      <description>&lt;P&gt;in the above RegEx statements, it keeps removing the backslash, so simply assume they are there in the RegEx statement above. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 17:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26735#M5178</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-11-07T17:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26736#M5179</link>
      <description>&lt;P&gt;You could try the built in Splunk extraction, since they are 2 different logs and logging methods, just extract the field "src_ip" in each, do a search including both log types and you will get the extracted results from both automagically.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.2/User/InteractiveFieldExtractionExample"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.2/User/InteractiveFieldExtractionExample&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 17:53:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26736#M5179</guid>
      <dc:creator>axinjakson</dc:creator>
      <dc:date>2012-11-07T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26737#M5180</link>
      <description>&lt;P&gt;It treats the backslash as an escape character. To get one to print within the body of the text, you'll have to use two together.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 18:20:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26737#M5180</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-11-07T18:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26738#M5181</link>
      <description>&lt;P&gt;Given that that the difference is the prefix, and the formatting of the address is the same, I might do something like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(DENIED|src)\s-\s(?&amp;lt;ip_here&amp;gt;\d+\.\d+\.\d+\.\d+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 18:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26738#M5181</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-11-07T18:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26739#M5182</link>
      <description>&lt;P&gt;This worked perfectly!!! Thank you very much!&lt;/P&gt;</description>
      <pubDate>Wed, 07 Nov 2012 21:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26739#M5182</guid>
      <dc:creator>tmarlette</dc:creator>
      <dc:date>2012-11-07T21:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26740#M5183</link>
      <description>&lt;P&gt;Consider accepting the answer if it helped you; in this way, others know that a good solution was found.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2012 13:22:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26740#M5183</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-11-08T13:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26741#M5184</link>
      <description>&lt;P&gt;hey there i hope this would help you.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;&lt;CODE&gt;D?E?N?I?E?D?s?r?c?\s-\s(?&amp;lt;ext_ip&amp;gt;d+.d+.d+.d+):\d{4}&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Mar 2013 19:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26741#M5184</guid>
      <dc:creator>eashwar</dc:creator>
      <dc:date>2013-03-16T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26742#M5185</link>
      <description>&lt;P&gt;Even you can solve the problem like this, you can give one same field with 2 diffrent extraction based on DENIED and src from splunk Web Gui.&lt;/P&gt;

&lt;P&gt;Kamal Bisht&lt;/P&gt;</description>
      <pubDate>Sun, 17 Mar 2013 03:38:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26742#M5185</guid>
      <dc:creator>kml_uvce</dc:creator>
      <dc:date>2013-03-17T03:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: RegEx  AND / OR?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26743#M5186</link>
      <description>&lt;P&gt;Note that your regex above would allow for many different prefixes before the IP and port, like:&lt;/P&gt;

&lt;P&gt;DEDrc -&lt;BR /&gt;
EIE - &lt;BR /&gt;
Dc -&lt;BR /&gt;
DD -&lt;BR /&gt;
ENDs -&lt;/P&gt;

&lt;P&gt;etc.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 17:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/RegEx-AND-OR/m-p/26743#M5186</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2013-03-18T17:05:27Z</dc:date>
    </item>
  </channel>
</rss>

