<?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 Could you help me make a query which returns results on devices that fail and succeed? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401218#M167380</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query that counts the type of failure for a given device, which works just fine.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice Properties.index=3 buildTarget=blah product=*|stats count by Properties.args{}| appendpipe [stats count | where count=0]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The request is if the device fails and retries (could be several times) but ultimately succeeds then don't count it as a failure.&lt;/P&gt;

&lt;P&gt;The data looks like this for a failure&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         CONNECTION_FAILURE 
        ]   
         category:   Event  
         index:  3  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    cox    
     clientSessionId:    DZLPTNZ-XQGUW  
     product:    Converge   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and if it succeeds it would look like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         CONNECTED  
        ]   
         category:   Event  
         index:  2  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    cox    
     clientSessionId:    DZLPTNZ-XQGUW  
     product:    Converge   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The client session ID is the common field.  Properties.index=3 contains all the failures while Properties.index=2 contains all the successes.  How would I go about doing this?&lt;/P&gt;</description>
    <pubDate>Wed, 26 Sep 2018 22:42:34 GMT</pubDate>
    <dc:creator>dbcase</dc:creator>
    <dc:date>2018-09-26T22:42:34Z</dc:date>
    <item>
      <title>Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401218#M167380</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query that counts the type of failure for a given device, which works just fine.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice Properties.index=3 buildTarget=blah product=*|stats count by Properties.args{}| appendpipe [stats count | where count=0]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The request is if the device fails and retries (could be several times) but ultimately succeeds then don't count it as a failure.&lt;/P&gt;

&lt;P&gt;The data looks like this for a failure&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         CONNECTION_FAILURE 
        ]   
         category:   Event  
         index:  3  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    cox    
     clientSessionId:    DZLPTNZ-XQGUW  
     product:    Converge   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and if it succeeds it would look like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{   [-] 
     Properties:    {   [-] 
         args:  [   [-] 
         CONNECTED  
        ]   
         category:   Event  
         index:  2  
    }   
     analyticType:   DynamicChoice  
     buildTarget:    cox    
     clientSessionId:    DZLPTNZ-XQGUW  
     product:    Converge   
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The client session ID is the common field.  Properties.index=3 contains all the failures while Properties.index=2 contains all the successes.  How would I go about doing this?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Sep 2018 22:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401218#M167380</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-09-26T22:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401219#M167381</link>
      <description>&lt;P&gt;@dbcase,&lt;/P&gt;

&lt;P&gt;Try this if you just want failure count&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice buildTarget=cox product=*
|stats latest(Properties.index) as StatusIndex,latest(Properties.args{}) as TypeOfFailures by clientSessionId
|where StatusIndex=3|stats count by TypeOfFailures
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And try this for both success and failures&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=wholesale_app DynamicChoice buildTarget=cox product=*
|stats latest(Properties.index) as StatusIndex,latest(Properties.args{}) as TypeOfFailures by clientSessionId
|stats count(eval(if(StatusIndex==3,clientSessionId,null()))) as Failures,
       count(eval(if(StatusIndex==2,clientSessionId,null()))) as Success by TypeOfFailures
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Sep 2018 03:15:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401219#M167381</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-27T03:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401220#M167382</link>
      <description>&lt;P&gt;This construction...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | stats count | where count=0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will never return anything.  &lt;CODE&gt;stats&lt;/CODE&gt; can only count what is there, so if nothing is there, it cannot be counted.&lt;/P&gt;

&lt;P&gt;Try something like &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=wholesale_app DynamicChoice (Properties.index=3 OR Properties.index=2) buildTarget=blah product=*
| stats count by Properties.args{} Properties.index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I suspect you may also need to include an &lt;CODE&gt;spath&lt;/CODE&gt; command to interpret the json before the &lt;CODE&gt;stats&lt;/CODE&gt; command.  &lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 03:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401220#M167382</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-09-27T03:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401221#M167383</link>
      <description>&lt;P&gt;Hmmmm the success and failure query above does output a stat table but has numerics in the type of failures column and success/failures always is zero&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401221#M167383</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-09-27T15:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401222#M167384</link>
      <description>&lt;P&gt;Hi,  This query works but doesn't seem to correlate a session where it failed to connect multiple times but then succeeds&lt;/P&gt;</description>
      <pubDate>Thu, 27 Sep 2018 15:38:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401222#M167384</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-09-27T15:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401223#M167385</link>
      <description>&lt;P&gt;@dbcase,&lt;BR /&gt;
are you getting result after &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=wholesale_app DynamicChoice buildTarget=cox product=*
 |stats latest(Properties.index) as StatusIndex,latest(Properties.args{}) as TypeOfFailures by clientSessionId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Sep 2018 12:40:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401223#M167385</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-28T12:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401224#M167386</link>
      <description>&lt;P&gt;yep looks like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;clientSessionId    StatusIndex TypeOfFailures&lt;BR /&gt;
DZLPUTF-ALWMOVJ 15  1726&lt;BR /&gt;
DZLQZKA-WSFXAP  15  9385&lt;BR /&gt;
DZLTKFI-BQWWEN  13  3152&lt;BR /&gt;
DZLUBKP-ALZFENT 2   STREAMING&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 15:27:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401224#M167386</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-09-28T15:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401225#M167387</link>
      <description>&lt;P&gt;ugh the formatting leaves a lot to be desired&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 15:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401225#M167387</guid>
      <dc:creator>dbcase</dc:creator>
      <dc:date>2018-09-28T15:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Could you help me make a query which returns results on devices that fail and succeed?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401226#M167388</link>
      <description>&lt;P&gt;@dbcase, thanks for that. From the output, the last record has a type of failure as "streaming" and gives me a 1 under success since the StatusIndex is 2. So it works for the last record. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TypeOfFailures  Failures    Success
1726    0   0
3152    0   0
9385    0   0
STREAMING   0   1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now for others (3 out of 4), the type of failures are coming as integers. What do you have in Properties.Args? Is that field extracted from JSON and has only the string values?&lt;/P&gt;</description>
      <pubDate>Sat, 29 Sep 2018 02:49:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Could-you-help-me-make-a-query-which-returns-results-on-devices/m-p/401226#M167388</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-09-29T02:49:08Z</dc:date>
    </item>
  </channel>
</rss>

