<?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 multiple phrases in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114211#M30196</link>
    <description>&lt;P&gt;I want to see if string a and string b are in the logs, but they might not be in the same event.&lt;BR /&gt;
And I don't want to create seperate query for each string. &lt;BR /&gt;
How do I do that?&lt;/P&gt;</description>
    <pubDate>Fri, 20 Jun 2014 21:28:23 GMT</pubDate>
    <dc:creator>lucychang2015</dc:creator>
    <dc:date>2014-06-20T21:28:23Z</dc:date>
    <item>
      <title>regex multiple phrases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114211#M30196</link>
      <description>&lt;P&gt;I want to see if string a and string b are in the logs, but they might not be in the same event.&lt;BR /&gt;
And I don't want to create seperate query for each string. &lt;BR /&gt;
How do I do that?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2014 21:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114211#M30196</guid>
      <dc:creator>lucychang2015</dc:creator>
      <dc:date>2014-06-20T21:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: regex multiple phrases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114212#M30197</link>
      <description>&lt;P&gt;I'm sure that's possible, got some sample data and desired results?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jun 2014 21:40:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114212#M30197</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-06-20T21:40:00Z</dc:date>
    </item>
    <item>
      <title>Re: regex multiple phrases</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114213#M30198</link>
      <description>&lt;P&gt;Well, if string a and string b are actual strings (not regular expressions), then this will work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"a" OR "b"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It would be nice to include a sourcetype, source, etc. in the above search, to make it more targeted and efficient. If the strings &lt;EM&gt;are&lt;/EM&gt; regular expresssions, then use this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| where match(_raw,"a") OR match(_raw,"b")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case, you will have to write some search that retrieves a set of data before applying the regular expression filter. While you could use the &lt;CODE&gt;regex&lt;/CODE&gt; command instead of the &lt;CODE&gt;where&lt;/CODE&gt; command, I often find this way easier. With &lt;CODE&gt;regex&lt;/CODE&gt;, you need to write a single regular expression. Combining "a" and "b" might be difficult or hard to understand.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jun 2014 18:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-multiple-phrases/m-p/114213#M30198</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-06-21T18:30:16Z</dc:date>
    </item>
  </channel>
</rss>

