<?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 do I use the &amp;quot;AND&amp;quot; operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139468#M38337</link>
    <description>&lt;P&gt;I have a search where the transaction status of a policy was set to FAIL.&lt;BR /&gt;
It was processed manually and now  it has changed to SUCCESS.&lt;/P&gt;

&lt;P&gt;I get the failed policies by the below search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="prod" sourcetype="PRD:syslog"  PROXYNAME="UAPI" URI="/vehicle/DeviceFullFillment" (TransactionStatus=Fail)| fields PolicyNumber by TransactionStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are couple of policies which both have TransactionStatus=FAIL and TransactionStatus=SUCCESS.&lt;BR /&gt;
How do I use "AND" operator or any other way to list all the policies which has both the status (FAIL and SUCCESS)&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2015 00:35:56 GMT</pubDate>
    <dc:creator>athorat</dc:creator>
    <dc:date>2015-07-28T00:35:56Z</dc:date>
    <item>
      <title>How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139468#M38337</link>
      <description>&lt;P&gt;I have a search where the transaction status of a policy was set to FAIL.&lt;BR /&gt;
It was processed manually and now  it has changed to SUCCESS.&lt;/P&gt;

&lt;P&gt;I get the failed policies by the below search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="prod" sourcetype="PRD:syslog"  PROXYNAME="UAPI" URI="/vehicle/DeviceFullFillment" (TransactionStatus=Fail)| fields PolicyNumber by TransactionStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There are couple of policies which both have TransactionStatus=FAIL and TransactionStatus=SUCCESS.&lt;BR /&gt;
How do I use "AND" operator or any other way to list all the policies which has both the status (FAIL and SUCCESS)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 00:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139468#M38337</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-07-28T00:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139469#M38338</link>
      <description>&lt;P&gt;Hi athorat,&lt;/P&gt;

&lt;P&gt;based on your comments I did update the answer, so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="prod" sourcetype="PRD:syslog"  PROXYNAME="UAPI" URI="/vehicle/DeviceFullFillment" TransactionStatus=fail OR TransactionStatus=success 
| stats count(TransactionStatus) AS myCount by PolicyNumber,  TransactionStatus
| where myCount&amp;gt;="2" 
| table PolicyNumber TransactionStatus
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will search all &lt;CODE&gt;PolicyNumber&lt;/CODE&gt; which have either &lt;CODE&gt;TransactionStatus=fail&lt;/CODE&gt; or &lt;CODE&gt;TransactionStatus=success&lt;/CODE&gt; and count them by &lt;CODE&gt;PolicyNumber&lt;/CODE&gt;, the &lt;CODE&gt;where&lt;/CODE&gt; claus will get back all &lt;CODE&gt;PolicyNumber&lt;/CODE&gt; which have a count of more or equal of &lt;CODE&gt;2&lt;/CODE&gt; and the shows the result as &lt;CODE&gt;table&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Hope this matches your requirements ...&lt;/P&gt;

&lt;P&gt;btw values are case in-sensitive that's why you can search for &lt;CODE&gt;TransactionStatus=Fail&lt;/CODE&gt; or &lt;CODE&gt;TransactionStatus=FAIL&lt;/CODE&gt; or &lt;CODE&gt;TransactionStatus=fAil&lt;/CODE&gt; and all will return the same events.&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 01:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139469#M38338</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-28T01:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139470#M38339</link>
      <description>&lt;P&gt;just to add, this will also work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="prod" AND sourcetype="PRD:syslog" AND PROXYNAME="UAPI" AND URI="/vehicle/DeviceFullFillment" AND TransactionStatus=fail AND TransactionStatus=success | fields PolicyNumber by TransactionStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 01:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139470#M38339</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-28T01:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139471#M38340</link>
      <description>&lt;P&gt;Thanks for the reply @Mus&lt;BR /&gt;
Well that some how does not return any results.&lt;BR /&gt;
If I use PolicyNumber=ABC prefix TransactionStatus=* before the pipe it shows both the status&lt;BR /&gt;
Anything which you can think of?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 02:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139471#M38340</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-07-28T02:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139472#M38341</link>
      <description>&lt;P&gt;Does your events really contain both fields like &lt;CODE&gt;TransactionStatus=fail&lt;/CODE&gt; and &lt;CODE&gt;TransactionStatus=success&lt;/CODE&gt; in the same one single event?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 03:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139472#M38341</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-28T03:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139473#M38342</link>
      <description>&lt;P&gt;@MuS, no those are two different events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; TransactionStatus=FAIL|TransactionDesc=AAA_RUNTIME_ERROR|EventCreationDate=2015-07-27T18:26:51Z|Latency=2.119|RiskState=AZ|PolicyNumber=AZSS203728899|ClubCode=002|RespData=ERROR|ErrorVINs=1G1JC6SH8F4157755|ErrorCode=UNEXPECTED_EXCEPTION|ErrorDesc=Octo did not retrurn voucher number and vin. - PolicyNumber:AZSS2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Second Event&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; TransactionStatus=SUCCESS|TransactionDesc=UBI Device Enrollment Response is sent to Reply Queue for all the requested vehicles|EventCreationDate=2015-07-27T18:26:53Z|Latency=6.782|RiskState=AZ|PolicyNumber:AZSS2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 03:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139473#M38342</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-07-28T03:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139474#M38343</link>
      <description>&lt;P&gt;Okay in this case you need to use the &lt;CODE&gt;OR&lt;/CODE&gt; in the search instead of &lt;CODE&gt;AND&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="prod" sourcetype="PRD:syslog"  PROXYNAME="UAPI" URI="/vehicle/DeviceFullFillment" TransactionStatus=fail OR TransactionStatus=success | fields PolicyNumber by TransactionStatus
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 03:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139474#M38343</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-28T03:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139475#M38344</link>
      <description>&lt;P&gt;Well as I was mentioning earlier we have 4 out of 121 policy numbers who has transaction status failed and success. If I use OR it returns all of the 121 events&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 04:27:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139475#M38344</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-07-28T04:27:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139476#M38345</link>
      <description>&lt;P&gt;Got it now - I think &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; See my updated answer ...&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2015 08:45:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139476#M38345</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-28T08:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the "AND" operator or any other way to list all values of a field that have both statuses FAIL and SUCCESS?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139477#M38346</link>
      <description>&lt;P&gt;Hi @MuS&lt;/P&gt;

&lt;P&gt;We are using Join to filter the data as the query further got enhanced.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="dpa" sourcetype="DP:PROD:SYSLOG" PROXYNAME="UBIAPI" URI="/vehicle/DeviceFullFillment"  TransactionStatus=FAIL   | join type=left CorrelationId [search index="dpa" sourcetype="DP:PROD:SYSLOG" PROXYNAME="UBIAPI" URI="/vehicle/DeviceFullFillment"  TransactionStatus !=FAIL]  | search TransactionStatus=FAIL  TransactionStatus=FAIL | append [search index="dpa" sourcetype="DP:PROD:SYSLOG" PROXYNAME="UBIAPI" URI="/vehicle/DeviceFullFillment"  TransactionStatus !=FAIL] 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2015 21:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-the-quot-AND-quot-operator-or-any-other-way-to-list/m-p/139477#M38346</guid>
      <dc:creator>athorat</dc:creator>
      <dc:date>2015-07-28T21:29:46Z</dc:date>
    </item>
  </channel>
</rss>

