<?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: Multiple 'Where' conditions in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526620#M148642</link>
    <description>&lt;P&gt;but OR will not give me the common data which occurs in all the duration set.I need common data&lt;/P&gt;</description>
    <pubDate>Tue, 27 Oct 2020 10:26:21 GMT</pubDate>
    <dc:creator>sweety1309</dc:creator>
    <dc:date>2020-10-27T10:26:21Z</dc:date>
    <item>
      <title>Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526574#M148618</link>
      <description>&lt;P&gt;Hi I have the below query.But its output is "no results found".I dont know what mistake am I making.Please help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="entab_due" Session=2019 ClassName="* *"&lt;BR /&gt;| join type=outer AdmissionNo, FeeInstallmentName, Session&lt;BR /&gt;[search index="entab_collection"]&lt;BR /&gt;| eval start = strptime(DueDate, "%d/%m/%Y")&lt;BR /&gt;| eval end = strptime(RecDate, "%d/%m/%Y")&lt;BR /&gt;| eval duration = round((end-start)/86400)&lt;BR /&gt;| where (duration &amp;gt; 45 and duration &amp;lt;= 75) AND (duration &amp;gt; 105 and duration &amp;lt;= 120) AND (duration &amp;gt; 120 and duration &amp;lt;= 180) AND (duration &amp;gt; 180)&lt;BR /&gt;| table AdmissionNo,StudentName&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 04:38:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526574#M148618</guid>
      <dc:creator>sweety1309</dc:creator>
      <dc:date>2020-10-27T04:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526579#M148620</link>
      <description>&lt;P&gt;Possibly conditions in the where clause is negating each other.&lt;/P&gt;&lt;P&gt;What's your expected result?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 05:30:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526579#M148620</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-10-27T05:30:11Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526580#M148621</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225566"&gt;@sweety1309&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the issue is with the where clause.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Say the duration is 108.&lt;/P&gt;&lt;P&gt;The where clause will not match on:&amp;nbsp;&lt;SPAN&gt; (duration &amp;gt; 45 and duration &amp;lt;= 75)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But will match on:&amp;nbsp; (duration &amp;gt; 105 and duration &amp;lt;= 120) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;However, the where clause uses AND between these terms, so the duration must be both less than 75 AND greater than 105.&lt;/P&gt;&lt;P&gt;Try replacing your ANDs with ORs:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where (duration &amp;gt; 45 AND duration &amp;lt;= 75) OR (duration &amp;gt; 105 AND duration &amp;lt;= 120) OR (duration &amp;gt; 120 AND duration &amp;lt;= 180) OR (duration &amp;gt; 180)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Seeing as you don't use the duration field, you could simplify it further:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where (duration &amp;gt; 45 AND duration &amp;lt;= 75) OR (duration &amp;gt; 105)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 05:33:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526580#M148621</guid>
      <dc:creator>danspav</dc:creator>
      <dc:date>2020-10-27T05:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526583#M148623</link>
      <description>&lt;P&gt;I need all data which is available in all three durations set&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 05:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526583#M148623</guid>
      <dc:creator>sweety1309</dc:creator>
      <dc:date>2020-10-27T05:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526588#M148625</link>
      <description>&lt;P&gt;try OR instead of AND&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 06:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526588#M148625</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-10-27T06:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526618#M148641</link>
      <description>&lt;P&gt;I need common data which occurs in all the duration set thats why i m using AND here&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:24:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526618#M148641</guid>
      <dc:creator>sweety1309</dc:creator>
      <dc:date>2020-10-27T10:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526620#M148642</link>
      <description>&lt;P&gt;but OR will not give me the common data which occurs in all the duration set.I need common data&lt;/P&gt;</description>
      <pubDate>Tue, 27 Oct 2020 10:26:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526620#M148642</guid>
      <dc:creator>sweety1309</dc:creator>
      <dc:date>2020-10-27T10:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple 'Where' conditions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526745#M148680</link>
      <description>&lt;P&gt;As mentioned earlier, conditions are negating each other.&lt;/P&gt;&lt;P&gt;For e.g. take first and last condition&lt;/P&gt;&lt;P&gt;sample adata :&lt;/P&gt;&lt;P&gt;duration = 1, 2,55,160,180&lt;/P&gt;&lt;P&gt;condition:&lt;/P&gt;&lt;P&gt;where (duration &amp;gt; 45 and duration &amp;lt;= 75)&lt;/P&gt;&lt;P&gt;AND (duration &amp;gt; 180)&lt;/P&gt;&lt;P&gt;In the above case, first condition will result in 55 and will be negated by AND in the second condition which &amp;gt; 180. So you wont get any result&lt;/P&gt;&lt;P&gt;sample search&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults|eval duration="1 2 55 160 180 200"|makemv duration|mvexpand duration
| where (duration &amp;gt; 45 and duration &amp;lt;= 75)
 OR (duration &amp;gt; 105 and duration &amp;lt;= 120) 
 OR (duration &amp;gt; 120 and duration &amp;lt;= 180) 
 OR (duration &amp;gt; 180)&lt;/LI-CODE&gt;&lt;P&gt;If this is not your requirement, please provide sample input duration and expected output&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 04:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Where-conditions/m-p/526745#M148680</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-10-28T04:13:48Z</dc:date>
    </item>
  </channel>
</rss>

