<?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: Match using OR statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106663#M27761</link>
    <description>&lt;P&gt;Match uses PCRE, so you have to escape "." as 1\.2\.3\.4, and you can use the | character as an OR operation:&lt;/P&gt;

&lt;P&gt;match(host, "1\.2\.3\.4|5\.6\.7\.8")&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jul 2013 18:04:21 GMT</pubDate>
    <dc:creator>reed_kelly</dc:creator>
    <dc:date>2013-07-25T18:04:21Z</dc:date>
    <item>
      <title>Match using OR statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106661#M27759</link>
      <description>&lt;P&gt;In in my host field I have several different addresses, 4 of these addresses are from Location1 and the rest are from Location2. I have constructed the below query to look for the matching addresses within the host fields and assign Location1 to those that match. I can't seem to look for the addresses I want to find in one match statement and the results from the query below, although correct, are a bit messy. Is is possible to use an OR statement within a match or is there another way of going about this?&lt;/P&gt;

&lt;P&gt;index=serverapps | eval Loc=if((match(host,"12.34.56.78*")),"Location1","Location2") | eval Loc1=if((match(host,"12.345.67.*")),"Location1","Location2") | stats count by host,Loc,Loc1&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106661#M27759</guid>
      <dc:creator>rlautman</dc:creator>
      <dc:date>2020-09-28T14:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Match using OR statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106662#M27760</link>
      <description>&lt;P&gt;why not use a lookup, that will be easy and will be reliable with more results coming in future. You can also use CASE for this as well.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 17:40:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106662#M27760</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-07-25T17:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: Match using OR statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106663#M27761</link>
      <description>&lt;P&gt;Match uses PCRE, so you have to escape "." as 1\.2\.3\.4, and you can use the | character as an OR operation:&lt;/P&gt;

&lt;P&gt;match(host, "1\.2\.3\.4|5\.6\.7\.8")&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2013 18:04:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106663#M27761</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2013-07-25T18:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Match using OR statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106664#M27762</link>
      <description>&lt;P&gt;This has worked a treat, thanks&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2013 16:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Match-using-OR-statement/m-p/106664#M27762</guid>
      <dc:creator>rlautman</dc:creator>
      <dc:date>2013-07-26T16:14:19Z</dc:date>
    </item>
  </channel>
</rss>

