<?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 How to phrase a search to find results if two conditions are met? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-phrase-a-search-to-find-results-if-two-conditions-are-met/m-p/645443#M223477</link>
    <description>&lt;P&gt;I am new to using Splunk and having some difficulties with the search query logic. I want to create a dashboard that displays the results of a condition being met, only if another condition is true. Example: if "PropertyOne"=true and "PropertyTwo"=5, return the instances where both of these conditions are met. I have tried using the if, match, and case functions, but I do not think I am using them correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search formats I've tried:&lt;/P&gt;&lt;P&gt;eval err=if("PropertyOne"=true, "PropertyTwo"=5)&lt;/P&gt;&lt;P&gt;if("PropertyOne"=false AND "PropertyTwo"=5)&lt;/P&gt;&lt;P&gt;eval err=if(match("PropertyOne"=false AND "PropertyTwo"=5), 1,0) &amp;lt;-- Here I added 1 and 0 because I didn't know what else to put in the other two slots needed for the "if" function.&lt;/P&gt;&lt;P&gt;eval err=case("PropertyOne"=true AND "PropertyTwo"=5)&lt;/P&gt;</description>
    <pubDate>Thu, 01 Jun 2023 20:54:19 GMT</pubDate>
    <dc:creator>beans123</dc:creator>
    <dc:date>2023-06-01T20:54:19Z</dc:date>
    <item>
      <title>How to phrase a search to find results if two conditions are met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-phrase-a-search-to-find-results-if-two-conditions-are-met/m-p/645443#M223477</link>
      <description>&lt;P&gt;I am new to using Splunk and having some difficulties with the search query logic. I want to create a dashboard that displays the results of a condition being met, only if another condition is true. Example: if "PropertyOne"=true and "PropertyTwo"=5, return the instances where both of these conditions are met. I have tried using the if, match, and case functions, but I do not think I am using them correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Search formats I've tried:&lt;/P&gt;&lt;P&gt;eval err=if("PropertyOne"=true, "PropertyTwo"=5)&lt;/P&gt;&lt;P&gt;if("PropertyOne"=false AND "PropertyTwo"=5)&lt;/P&gt;&lt;P&gt;eval err=if(match("PropertyOne"=false AND "PropertyTwo"=5), 1,0) &amp;lt;-- Here I added 1 and 0 because I didn't know what else to put in the other two slots needed for the "if" function.&lt;/P&gt;&lt;P&gt;eval err=case("PropertyOne"=true AND "PropertyTwo"=5)&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 20:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-phrase-a-search-to-find-results-if-two-conditions-are-met/m-p/645443#M223477</guid>
      <dc:creator>beans123</dc:creator>
      <dc:date>2023-06-01T20:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to phrase a search to find results if two conditions are met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-phrase-a-search-to-find-results-if-two-conditions-are-met/m-p/645455#M223485</link>
      <description>&lt;P&gt;There are a few ways to do that, depending on what you want to do with the condition.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval result=if(PropertyOne=5 AND PropertyTwo=0, 1, 0)
| where result=1

| where (PropertyOne=5 AND PropertyTwo=0)

| search PropertyOne=5 AND PropertyTwo=0&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jun 2023 00:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-phrase-a-search-to-find-results-if-two-conditions-are-met/m-p/645455#M223485</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-06-02T00:17:36Z</dc:date>
    </item>
  </channel>
</rss>

