<?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: How do I &amp;quot;OR&amp;quot; two regexs for two different fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440151#M125165</link>
    <description>&lt;P&gt;It's definitely possible using eval and then a single regex search, but if anyone else has a less messy and more elegant way of doing this, it would be much appreciated (and I'm sure other people will/have wanted to do the same thing)&lt;/P&gt;</description>
    <pubDate>Thu, 30 Aug 2018 20:18:51 GMT</pubDate>
    <dc:creator>nick405060</dc:creator>
    <dc:date>2018-08-30T20:18:51Z</dc:date>
    <item>
      <title>How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440146#M125160</link>
      <description>&lt;P&gt;I need to be able to do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | regex fieldA="&amp;lt;regex&amp;gt;" OR regex fieldB="&amp;lt;regex&amp;gt;" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;All of the other rex answers are suggesting a pipe, which wouldn't work here as far as I know.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 18:55:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440146#M125160</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-30T18:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440147#M125161</link>
      <description>&lt;P&gt;Why use an OR? Why not just create two different fields? You're trying to capture different values right?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 19:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440147#M125161</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-08-30T19:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440148#M125162</link>
      <description>&lt;P&gt;I already have the two fields. I need to alert if one or both of them matches their respective regex.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 19:44:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440148#M125162</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-30T19:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440149#M125163</link>
      <description>&lt;P&gt;I think you can achieve this with &lt;CODE&gt;eval&lt;/CODE&gt; rather than rex. Can you paste some redacted events.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440149#M125163</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-30T20:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440150#M125164</link>
      <description>&lt;P&gt;regex sender="(?i)abc\d+@gmail.com" OR&lt;BR /&gt;
message_subject="aBC|baC"&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440150#M125164</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-30T20:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440151#M125165</link>
      <description>&lt;P&gt;It's definitely possible using eval and then a single regex search, but if anyone else has a less messy and more elegant way of doing this, it would be much appreciated (and I'm sure other people will/have wanted to do the same thing)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 20:18:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440151#M125165</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-30T20:18:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440152#M125166</link>
      <description>&lt;P&gt;Give this a shot (not tested; might work): &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval x=if(match(sender, "(?i)abc\d+@gmail.com"), 1, null)
    | eval y=if(match(message_subject, "aBC|baC"), 1, null)
    | stats  count by x, y 
    | where count &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Aug 2018 21:34:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440152#M125166</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-08-30T21:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440153#M125167</link>
      <description>&lt;P&gt;Thanks a bunch!! An admin should convert your comment to an answer. Much more elgant than what I did. I concat’d the two fields with a “#” in between and then regex’d on that new single field; the regex OR’d the before # and after #. Your solution is neater.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 22:15:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440153#M125167</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2018-08-30T22:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I "OR" two regexs for two different fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440154#M125168</link>
      <description>&lt;P&gt;Hi @nick405060, you asked and therefore, you received. I converted @nittala_surya 's comment to an answer. Would you mind approving it for me? Why not throw that user an upvote while you're at it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Aug 2018 22:18:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-quot-OR-quot-two-regexs-for-two-different-fields/m-p/440154#M125168</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-08-30T22:18:59Z</dc:date>
    </item>
  </channel>
</rss>

