<?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: query on using AND ,OR in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126443#M34235</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
This should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=fer ("file" AND "SUCCESS: File successfully uploaded") OR ( "file" AND "MAJOR") source="*.dbg0.log" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jan 2014 09:52:26 GMT</pubDate>
    <dc:creator>linu1988</dc:creator>
    <dc:date>2014-01-27T09:52:26Z</dc:date>
    <item>
      <title>query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126442#M34234</link>
      <description>&lt;P&gt;20131209.dbg0.log:2013-12-09 17:52:12,435 [58c8]    SUCCESS: File successfully uploaded using SFTP. Filename was [nv_afis_nav_download12092013145008.csv]. File length was [1403]. &lt;BR /&gt;
20131209.dbg0.log:2013-12-05 15:34:00,895 [275f275f] MAJOR: File [/ftxprd1/BNYM_NONPROD_ZEROBYTE_TESTING/dir_monitor/Zero_Byte_Check_92kb.log] already exists. [.io.agents.filecopy.Filecopy]&lt;BR /&gt;&lt;BR /&gt;
20131220.server-status0.log:13-12-20 09:38:00 [76aa]    SUCCESS: The FTP Server [rsba.net - FTP SERVER] uploaded file [/outbound/_2_113237579.csv] of length 1989 bytes from userid [EBD]. The [EBD] user logged in from [17.61.10.10:358] with security mode [DISABLED].&lt;/P&gt;

&lt;P&gt;From the above mentioned events, the following exact phrases / strings need to be searched.&lt;/P&gt;

&lt;P&gt;events containing the word "file"&lt;BR /&gt;
events containing the phrase "SUCCESS: File successfully uploaded"&lt;BR /&gt;
events containing the phrase "MAJOR:"&lt;BR /&gt;
Note : Events should contain ("file" &amp;amp; "SUCCESS: File successfully uploaded") (OR) ("file" &amp;amp; "MAJOR"). &lt;/P&gt;

&lt;P&gt;Output should look like &lt;/P&gt;

&lt;P&gt;Output : &lt;BR /&gt;
20131209.dbg0.log:2013-12-09 17:52:12,435 [58c8]    SUCCESS: File successfully uploaded using SFTP. Filename was [nv_afis_nav_download12092013145008.csv]. File length was [1403]. &lt;BR /&gt;
20131209.dbg0.log:2013-12-05 15:34:00,895 [275f275f] MAJOR: File [/ftxprd1/BNYM_NONPROD_ZEROBYTE_TESTING/dir_monitor/Zero_Byte_Check_92kb.log] already exists. [.io.agents.filecopy.Filecopy]    &lt;/P&gt;

&lt;P&gt;I tried with the following query as&lt;/P&gt;

&lt;P&gt;index=fer file AND ("SUCCESS: File successfully uploaded" OR "MAJOR") |search source="*.dbg0.log" &lt;/P&gt;

&lt;P&gt;I didn't get desired result.Could you please correct the query to fetch the desired events.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:43:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126442#M34234</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2020-09-28T15:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126443#M34235</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
This should work.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=fer ("file" AND "SUCCESS: File successfully uploaded") OR ( "file" AND "MAJOR") source="*.dbg0.log" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 09:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126443#M34235</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-01-27T09:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126444#M34236</link>
      <description>&lt;P&gt;The search query you gave is not fetching the results as expected.If i give SUCCESS: alone or MAJOR alone like&lt;BR /&gt;
index=fer "file" AND ("SUCCESS:" OR "MAJOR:") source="&lt;EM&gt;.dbg0.log".&lt;BR /&gt;
The events are listed according to the query given.But,when given like&lt;BR /&gt;
index=fer "file" AND ("SUCCESS: File successfully uploaded" OR "MAJOR: File ") source="&lt;/EM&gt;.dbg0.log".&lt;BR /&gt;
Nothing is listed out.Can you say why it is happening and resolve it&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 12:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126444#M34236</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2014-01-27T12:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126445#M34237</link>
      <description>&lt;P&gt;Modified the query as the your comment.&lt;/P&gt;

&lt;P&gt;Note : Events should contain ("file" &amp;amp; "SUCCESS: File successfully uploaded") (OR) ("file" &amp;amp; "MAJOR")&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2014 12:28:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126445#M34237</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2014-01-27T12:28:55Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126446#M34238</link>
      <description>&lt;P&gt;index=fxr file AND (MAJOR) OR (SUCCESS: AND File AND successfully AND uploaded)|search source="&lt;EM&gt;.dbg-*trc&lt;/EM&gt;.log"&lt;/P&gt;

&lt;P&gt;This query fetched correct number of events as expected.I want to confirm whether splunk follows right to left associativity in the above query or what?Because the following query also fetched the same results as expected.&lt;/P&gt;

&lt;P&gt;index=fxr (file) AND ((MAJOR) OR (SUCCESS: AND File AND successfully AND uploaded))|search source="&lt;EM&gt;.dbg-*trc&lt;/EM&gt;.log"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126446#M34238</guid>
      <dc:creator>Jananee_iNautix</dc:creator>
      <dc:date>2020-09-28T15:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126447#M34239</link>
      <description>&lt;P&gt;Just try like this , I think that it may be  done :    &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;      index=fer    source="*.dbg0.log" (“ file”  AND "SUCCESS: File successfully uploaded") OR (“file” AND "MAJOR") 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Dec 2014 12:31:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126447#M34239</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2014-12-12T12:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: query on using AND ,OR</title>
      <link>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126448#M34240</link>
      <description>&lt;P&gt;Hi Jananee_iNautix,&lt;BR /&gt;
You wanted, in your comment to know if splunk is processing left to right association.&lt;BR /&gt;
WHEN YOU RUN A QUERY LIKE THAT,SPLUNK PROCESS THE EVENT IN THIER ARRIVING ODER.&lt;/P&gt;

&lt;P&gt;CONCERNING THE QUERY, splunk proces from left to right, But NOTE THAT all the search element are always process. AND NO Matter the order of OR and AND the other of the resulting events will be the same if you don't SORT or transform it.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Apr 2015 15:11:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/query-on-using-AND-OR/m-p/126448#M34240</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-19T15:11:18Z</dc:date>
    </item>
  </channel>
</rss>

