<?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 use Stats command ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375599#M110363</link>
    <description>&lt;P&gt;Hi Splunker,&lt;/P&gt;

&lt;P&gt;I have a logs which has &lt;BR /&gt;
Defect ID ,Actual Fix Time Taken,Detected By,Priority.&lt;/P&gt;

&lt;P&gt;I would like to calculate maximum  value  of &lt;STRONG&gt;Actual Fix time&lt;/STRONG&gt; taken by  each &lt;STRONG&gt;Priority&lt;/STRONG&gt; and simultaneously i would like to see the &lt;STRONG&gt;Defect Id&lt;/STRONG&gt; as well&lt;BR /&gt;
My output should look like that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Priority    Defect ID   Detected by Maximum Actual Fix time(In days)
P1           1234            x                 2
P2           767              Y                5
P3           122              z                20
P4           3526            T                 67
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note:- Actual Fix time  means time taken to fix the defect and here i would like to know the Defect ID for which maximum time taken to close that defect against each priority.&lt;/P&gt;

&lt;P&gt;I tried using below mentioned query&lt;/P&gt;

&lt;P&gt;source="Jcaps_Logs.csv"  index="jcaps" sourcetype="csv" &lt;/P&gt;

&lt;P&gt;| fillnull value=NULL "Actual Fix Time" &lt;BR /&gt;
| search "Actual Fix Time"!=NULL &lt;BR /&gt;
| stats max("Actual Fix Time") as maxy  by "Priority","Defect ID"&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jul 2017 15:29:22 GMT</pubDate>
    <dc:creator>m7787580</dc:creator>
    <dc:date>2017-07-03T15:29:22Z</dc:date>
    <item>
      <title>How to use Stats command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375599#M110363</link>
      <description>&lt;P&gt;Hi Splunker,&lt;/P&gt;

&lt;P&gt;I have a logs which has &lt;BR /&gt;
Defect ID ,Actual Fix Time Taken,Detected By,Priority.&lt;/P&gt;

&lt;P&gt;I would like to calculate maximum  value  of &lt;STRONG&gt;Actual Fix time&lt;/STRONG&gt; taken by  each &lt;STRONG&gt;Priority&lt;/STRONG&gt; and simultaneously i would like to see the &lt;STRONG&gt;Defect Id&lt;/STRONG&gt; as well&lt;BR /&gt;
My output should look like that&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Priority    Defect ID   Detected by Maximum Actual Fix time(In days)
P1           1234            x                 2
P2           767              Y                5
P3           122              z                20
P4           3526            T                 67
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note:- Actual Fix time  means time taken to fix the defect and here i would like to know the Defect ID for which maximum time taken to close that defect against each priority.&lt;/P&gt;

&lt;P&gt;I tried using below mentioned query&lt;/P&gt;

&lt;P&gt;source="Jcaps_Logs.csv"  index="jcaps" sourcetype="csv" &lt;/P&gt;

&lt;P&gt;| fillnull value=NULL "Actual Fix Time" &lt;BR /&gt;
| search "Actual Fix Time"!=NULL &lt;BR /&gt;
| stats max("Actual Fix Time") as maxy  by "Priority","Defect ID"&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:29:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375599#M110363</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-07-03T15:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Stats command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375600#M110364</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="Jcaps_Logs.csv" index="jcaps" sourcetype="csv"
| fillnull value=-1 "Actual Fix Time" 
| sort 0 Priority -"Actual Fix Time"
| dedup Priority
| table Priority "Defect ID" "Detected By" "Actual Fix Time" 
| eval "Actual Fix Time"=if('Actual Fix Time'=-1,"NULL",'Actual Fix Time")
| rename "Actual Fix Time" as "Maximum Actual Fix time(In days)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Jul 2017 15:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375600#M110364</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-03T15:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Stats command ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375601#M110365</link>
      <description>&lt;P&gt;Many thanks  somesoni2&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 08:36:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-Stats-command/m-p/375601#M110365</guid>
      <dc:creator>m7787580</dc:creator>
      <dc:date>2017-07-05T08:36:45Z</dc:date>
    </item>
  </channel>
</rss>

