<?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: How to calculate no of opened ticket in past in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395817#M172852</link>
    <description>&lt;P&gt;Hi Chris,&lt;/P&gt;

&lt;P&gt;I tried above solution given by you , it is not working as expected.&lt;/P&gt;

&lt;P&gt;Here i want to match the results with given time interval  to dv_opened_at time stamp in logs .&lt;BR /&gt;
As there are incident keeps updating its state ....thats why we have dv_updated_ on fields also.&lt;/P&gt;

&lt;P&gt;Example: my search timing is last 24 hours, means i want to calculate total no. Of incidents opened by users irrespective of its current state of ticket. Just i want no. Of incidents raised by users.&lt;BR /&gt;
Time at incidents opened are dv_ opened _ at.&lt;/P&gt;

&lt;P&gt;Now i am discussion ing problem case-&lt;/P&gt;

&lt;P&gt;Results of my search&lt;/P&gt;

&lt;P&gt;INC1-  opened at 22feb at 2:12 it is acceptable&lt;/P&gt;

&lt;P&gt;But INC2 opened at 12 NOV 2018 which is not required as per our requirements but this incident got modified on 22 feb at 10:06 thats why we are getting these too.&lt;BR /&gt;
We have multiple incidents which is not required how we can exclude those kind of incidents.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 23:20:27 GMT</pubDate>
    <dc:creator>himanshu_b_shek</dc:creator>
    <dc:date>2020-09-29T23:20:27Z</dc:date>
    <item>
      <title>How to calculate no of opened ticket in past in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395815#M172850</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;i want to calculate total no . of opened incidents by a user over a time interval in dynamic environment in splunk (assuming the time input via time picker and we have snow data in splunk )&lt;/P&gt;

&lt;P&gt;for example i want to calculate total no. of opened incident by users  from 15 feb 19 to 20 feb 19 .(obviously some ticket will be in closed , resolved, in progress , new ....etc states)&lt;/P&gt;

&lt;P&gt;we have dv_opened_at , dv_closed_at , sys_updated_on, dv_number fields in splunk as below -&lt;/P&gt;

&lt;P&gt;dv_number   Team_Name                            dv_state                           dv_opened_at                sys_updated_on&lt;BR /&gt;
INC0346726  Desktop Computing            Updated by Customer    1/21/2019 7:34              2/22/2019 18:45&lt;BR /&gt;
INC0349402  IAM                                         In Progress                       1/23/2019 19:28               2/22/2019 16:57&lt;BR /&gt;
INC0363170  Desktop Computing          On Hold                                   2/7/2019 20:19             2/22/2019 19:10&lt;BR /&gt;
INC0368256  Desktop Computing           On Hold                                 2/13/2019 19:53             2/22/2019 18:58&lt;BR /&gt;
INC0370984                                                      On Hold                         2/16/2019 18:46             2/22/2019 18:17&lt;BR /&gt;
INC0375322  Updated by Customer                                                         2/20/2019 16:13              2/22/2019 17:58&lt;BR /&gt;
INC0375327  Endpoint Security          Updated by Customer        2/20/2019 16:18               2/22/2019 18:48&lt;BR /&gt;
INC0375361  Desktop Computing                In Progress                   2/20/2019 17:22               2/22/2019 16:58&lt;BR /&gt;
INC0376457                                                      In Progress                 2/21/2019 11:12              2/22/2019 18:48&lt;BR /&gt;
INC0376813  Desktop Computing              In Progress                         2/21/2019 22:33               2/22/2019 18:26&lt;BR /&gt;
INC0377715  IAM                                                 New                        2/22/2019 17:24               2/22/2019 17:27&lt;BR /&gt;
INC0377755  Messaging                                    New                            2/22/2019 18:56              2/22/2019 19:14&lt;/P&gt;

&lt;P&gt;this log is pulled by splunk in last 4 hours(22 feb), here we can see have  we have OLDER incidents also we are getting all those incidents because those got updated in this time interval .&lt;/P&gt;

&lt;P&gt;How we can exclude all those incidents ??&lt;BR /&gt;
Thanks in advance &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395815#M172850</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2020-09-29T23:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate no of opened ticket in past in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395816#M172851</link>
      <description>&lt;P&gt;The trick with service-now data is to make sure you are only looking at the current version of the record, by its sys_id. This means you should use a search like the below to &lt;CODE&gt;| stats&lt;/CODE&gt; it.  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=snow | stats latest(dv_opened_at) as dv_opened_at by sys_id | then_do_your_time_comparisons...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Feb 2019 22:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395816#M172851</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-22T22:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate no of opened ticket in past in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395817#M172852</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;

&lt;P&gt;I tried above solution given by you , it is not working as expected.&lt;/P&gt;

&lt;P&gt;Here i want to match the results with given time interval  to dv_opened_at time stamp in logs .&lt;BR /&gt;
As there are incident keeps updating its state ....thats why we have dv_updated_ on fields also.&lt;/P&gt;

&lt;P&gt;Example: my search timing is last 24 hours, means i want to calculate total no. Of incidents opened by users irrespective of its current state of ticket. Just i want no. Of incidents raised by users.&lt;BR /&gt;
Time at incidents opened are dv_ opened _ at.&lt;/P&gt;

&lt;P&gt;Now i am discussion ing problem case-&lt;/P&gt;

&lt;P&gt;Results of my search&lt;/P&gt;

&lt;P&gt;INC1-  opened at 22feb at 2:12 it is acceptable&lt;/P&gt;

&lt;P&gt;But INC2 opened at 12 NOV 2018 which is not required as per our requirements but this incident got modified on 22 feb at 10:06 thats why we are getting these too.&lt;BR /&gt;
We have multiple incidents which is not required how we can exclude those kind of incidents.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395817#M172852</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2020-09-29T23:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate no of opened ticket in past in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395818#M172853</link>
      <description>&lt;P&gt;Hi Himanshu,&lt;/P&gt;

&lt;P&gt;You need to add a filter based on your dv_opened_at  field to filter out the events out of your search results.&lt;/P&gt;

&lt;P&gt;I have created a small sample for you. &lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval dv_opened_at="1/14/2019 7:34"&lt;BR /&gt;
| append &lt;BR /&gt;
[ | makeresults &lt;BR /&gt;
| eval dv_opened_at="1/15/2019 7:34"]&lt;BR /&gt;
| eval unix_time=strptime(dv_opened_at, "%m/%d/%Y %H:%M")&lt;BR /&gt;
| eval search_start_time=strptime("1/15/2019", "%m/%d/%Y")&lt;BR /&gt;
| where unix_time&amp;gt;search_start_time&lt;/P&gt;

&lt;P&gt;You may similarly add search end time as well in the criteria.&lt;/P&gt;

&lt;P&gt;Let me know if it answers your question&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395818#M172853</guid>
      <dc:creator>cvssravan</dc:creator>
      <dc:date>2020-09-29T23:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate no of opened ticket in past in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395819#M172854</link>
      <description>&lt;P&gt;Hi Chris,&lt;/P&gt;

&lt;P&gt;I developed below query -&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;euc_team_sm&lt;/CODE&gt; &lt;BR /&gt;
| dedup dv_number &lt;BR /&gt;
| table dv_number Team_Name dv_state dv_opened_at dv_closed_at sys_updated_on &lt;BR /&gt;
| eval dv_opened_at_epoc = strptime(dv_opened_at, "%Y-%m-%d %H:%M:%S")| search (dv_opened_at_epoc &amp;gt;= "$timerange.earliest$" AND dv_opened_at_epoc &amp;lt;= "$timerange.latest$") | stats count by Team_Name &lt;/P&gt;

&lt;P&gt;This query gives correct results with some limitations -&lt;/P&gt;

&lt;P&gt;Please provide the time input in below time format  via "Time Range " picker - &lt;BR /&gt;
-Date Range (Between)&lt;BR /&gt;
-Date &amp;amp; Time Range (Between)&lt;BR /&gt;
When we pass time range in above format splunk pass time in epoc format to search so accordingly i am getting as expected results.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;euc_team_sm&lt;/CODE&gt; &lt;BR /&gt;
| dedup dv_number &lt;BR /&gt;
| table dv_number Team_Name dv_state dv_opened_at dv_closed_at sys_updated_on &lt;BR /&gt;
| eval dv_opened_at_epoc = strptime(dv_opened_at, "%Y-%m-%d %H:%M:%S")| search (dv_opened_at_epoc &amp;gt;= "1550815200" AND dv_opened_at_epoc &amp;lt;= "1550988000") | stats count by Team_Name&lt;/P&gt;

&lt;P&gt;BUT when we pass time other than above mentioed format then search give WRONG result becuase in this case splunk not passing time in epoc format , out query based on epoc time format .&lt;BR /&gt;
Sample result -(It will be wrong result)&lt;BR /&gt;
&lt;CODE&gt;euc_team_sm&lt;/CODE&gt; &lt;BR /&gt;
| dedup dv_number &lt;BR /&gt;
| table dv_number Team_Name dv_state dv_opened_at dv_closed_at sys_updated_on &lt;BR /&gt;
| eval dv_opened_at_epoc = strptime(dv_opened_at, "%Y-%m-%d %H:%M:%S")| search (dv_opened_at_epoc &amp;gt;= "-24h@h" AND dv_opened_at_epoc &amp;lt;= "now") | stats count by Team_Name&lt;/P&gt;

&lt;P&gt;Here if we can generalize the query that can take any time value first convert it in epoc then we can achieve our desired result .&lt;/P&gt;

&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:20:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-no-of-opened-ticket-in-past-in-splunk/m-p/395819#M172854</guid>
      <dc:creator>himanshu_b_shek</dc:creator>
      <dc:date>2020-09-29T23:20:42Z</dc:date>
    </item>
  </channel>
</rss>

