<?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 you find the count of hours between two dates? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401784#M116253</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please find the below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service"  CaseNumber=* status="Complete"  assignment_group=* |dedup CaseNumber,assignment_group| streamstats current=f last(assignment_group) as lg, last(active) as  Active by CaseNumber |eval ss=case(assignment_group!=lg AND assignment_group="Sustaining","Escalated")|eval comein=strptime(Created_ON,"%Y-%m-%d %H:%M:%S") | eval goout=strptime(Updated_ON,"%Y-%m-%d %H:%M:%S") | eval diff= round((goout - comein)/3600*24,0)|eval total_hours=diff/24|table CaseNumber,Created_ON,Updated_ON,total_hours
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want get the hours counted for escalated cases only, but I am getting counts for both escalated and resolved with the above query(assignment_group is the group).&lt;/P&gt;

&lt;P&gt;Please help to get the correct results.&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 12:11:26 GMT</pubDate>
    <dc:creator>ramesh12345</dc:creator>
    <dc:date>2019-02-19T12:11:26Z</dc:date>
    <item>
      <title>How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401784#M116253</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Please find the below query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service"  CaseNumber=* status="Complete"  assignment_group=* |dedup CaseNumber,assignment_group| streamstats current=f last(assignment_group) as lg, last(active) as  Active by CaseNumber |eval ss=case(assignment_group!=lg AND assignment_group="Sustaining","Escalated")|eval comein=strptime(Created_ON,"%Y-%m-%d %H:%M:%S") | eval goout=strptime(Updated_ON,"%Y-%m-%d %H:%M:%S") | eval diff= round((goout - comein)/3600*24,0)|eval total_hours=diff/24|table CaseNumber,Created_ON,Updated_ON,total_hours
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want get the hours counted for escalated cases only, but I am getting counts for both escalated and resolved with the above query(assignment_group is the group).&lt;/P&gt;

&lt;P&gt;Please help to get the correct results.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 12:11:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401784#M116253</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-19T12:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401785#M116254</link>
      <description>&lt;P&gt;@ramesh12345,&lt;/P&gt;

&lt;P&gt;What about adding &lt;CODE&gt;|where ss="Escalated"&lt;/CODE&gt; at the end of your search?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401785#M116254</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-19T14:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401786#M116255</link>
      <description>&lt;P&gt;Sorry i didnt get u clearly&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:07:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401786#M116255</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-19T14:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401787#M116256</link>
      <description>&lt;P&gt;if you only want the result of only "Escalated" cases, you can filter them by adding &lt;CODE&gt;where&lt;/CODE&gt; condition. In your search you have field &lt;CODE&gt;ss&lt;/CODE&gt; which is assigned with "Escalated" based on some condition. So try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="os" sourcetype="Service" CaseNumber= status="Complete" assignment_group= |dedup CaseNumber,assignment_group| streamstats current=f last(assignment_group) as lg, last(active) as Active by CaseNumber |eval ss=case(assignment_group!=lg AND assignment_group="Sustaining","Escalated")|eval comein=strptime(Created_ON,"%Y-%m-%d %H:%M:%S") | eval goout=strptime(Updated_ON,"%Y-%m-%d %H:%M:%S") | eval diff= round((goout - comein)/3600*24,0)|eval total_hours=diff/24|table CaseNumber,Created_ON,Updated_ON,total_hours
|where ss="Escalated"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If this is not what you are looking for, then please provide some sample data (anonymize confidential information) from current output and expected output&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:13:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401787#M116256</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-19T14:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401788#M116257</link>
      <description>&lt;P&gt;Not displaying anydata when i given |where ss="Escalated" at the end of the query&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401788#M116257</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-19T14:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401789#M116258</link>
      <description>&lt;P&gt;Do you have &lt;CODE&gt;ss&lt;/CODE&gt; field in your end result and displaying some data? Is it possible to provide some sample output  and also the expected output based on that? &lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:20:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401789#M116258</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-19T14:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401790#M116259</link>
      <description>&lt;P&gt;Is this complete query? You &lt;CODE&gt;eval ss=case&lt;/CODE&gt; seems to have just one condition, is that intended?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:46:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401790#M116259</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-02-19T14:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401791#M116260</link>
      <description>&lt;P&gt;It's working fine.I just modified my query and added your condition.Thank u so much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:58:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401791#M116260</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2019-02-19T14:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401792#M116261</link>
      <description>&lt;P&gt;Hi, Ihave another issue with my query&lt;/P&gt;

&lt;P&gt;index="os" sourcetype="Service" CaseNumber=* assignment_group=* status="Complete" active=false (Group="Connectivity" OR Group="Data") AND (Section="Local" OR Section="data") AND (Component="Power" OR Component="health")|dedup CaseNumber,assignment_group|streamstats current=f last(assignment_group) as lg,last(active) as  Active by CaseNumber| eval ss=case(assignment_group!=lg AND assignment_group="Sustaining","Closed By Other",assignment_group="Sustaining" AND (isnull(Active) OR Active="true"),"Closed By Team") |timechart span=1d count by ss usenull=f&lt;/P&gt;

&lt;P&gt;when i execute this query it is not displaying "Closed By Other" cases count.&lt;/P&gt;

&lt;P&gt;for understanding purpose initially assignment_group="Sustaining" but if this changed to other group then it is called as escalated case.&lt;/P&gt;

&lt;P&gt;here within assignment_group="Sustaining" group status="Complete" and active=false then it is resolved cases by Team.It is showing correct count.&lt;/P&gt;

&lt;P&gt;But for escalation it is not displaying count for  closed cases.i dont know why.Please help hoe to do this&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401792#M116261</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401793#M116262</link>
      <description>&lt;P&gt;Check the order and condition in your eval-case. Whatever is the specific case, that condition should be put first.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 17:03:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401793#M116262</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-02-19T17:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401794#M116263</link>
      <description>&lt;P&gt;why not just have this :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;assignment_group="Sustaining","Closed By Other",assignment_group="Sustaining" AND (isnull(Active) OR Active="true"),"Closed By Team")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 18:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401794#M116263</guid>
      <dc:creator>macadminrohit</dc:creator>
      <dc:date>2019-02-19T18:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401795#M116264</link>
      <description>&lt;P&gt;@ramesh12345 If your problem is resolved, please accept the answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 19:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401795#M116264</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-02-19T19:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the count of hours between two dates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401796#M116265</link>
      <description>&lt;P&gt;Above condition given same result right?&lt;BR /&gt;
Because assignment_group is same.i want first assignment_group is  "Sustaining" and change in assignment_group is anything.i want that closed cases count.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-find-the-count-of-hours-between-two-dates/m-p/401796#M116265</guid>
      <dc:creator>ramesh12345</dc:creator>
      <dc:date>2020-09-29T23:23:19Z</dc:date>
    </item>
  </channel>
</rss>

