<?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 do I edit my search to calculate Ticket Resolution Time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251293#M75099</link>
    <description>&lt;P&gt;Single quotes can be used to quote field names with spaces. I use them during an eval. e.g. &lt;BR /&gt;
&lt;CODE&gt;| eval MyField = 'some other field'&lt;/CODE&gt; will treat 'some other field' as an actual field name. Whereas, &lt;CODE&gt;| eval MyField = "some other field"&lt;/CODE&gt; will set MyField to the literal string of "some other field"&lt;/P&gt;

&lt;P&gt;I made up the TicketNumber field. I assume there is one in your events, or some other ID that you can key off of? Change it to that field name.&lt;/P&gt;

&lt;P&gt;If you redo your field extractions with underscores, it would look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sdp Department="*" "Request Status"="*" Level="*" | rename Level as Complexity |transaction TicketNumber startswith=(Request Status=Open*) endswith=(Request_Status=Resolved OR Request_Status=Closed) | stats sum(duration) as TimeOpen by Complexity 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See also: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Identifyandgroupeventsintotransactions#Transaction_search_options"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Identifyandgroupeventsintotransactions#Transaction_search_options&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2016 00:52:59 GMT</pubDate>
    <dc:creator>masonmorales</dc:creator>
    <dc:date>2016-01-29T00:52:59Z</dc:date>
    <item>
      <title>How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251282#M75088</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;So currently I am pulling a report with all tickets that have been created this year. For the Ticket Resolution Time, I am trying to obtain how long it takes for a ticket to go from an open state to a "Request Status = Resolved or Closed" state. I want to break down all of these resolved &amp;amp; closed tickets based on their complexity to give me an average resolution time based on the 4 complexities (Intensive, intermediate, moderate, and minimal.) This can be 4 separate single value displays.&lt;/P&gt;

&lt;P&gt;Currently I am stuck with the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sdp Department="*" "Request Status"=Closed OR "Request Status"=Resolved Level="*" | rename Level as Complexity | eval _time=strptime('Start Time',"%Y-%m-%dT%H:%M:%S.%3N-%z") | timechart span=1d count by "Complexity"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2016 22:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251282#M75088</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-28T22:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251283#M75089</link>
      <description>&lt;P&gt;Probably something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sdp Department="*" "Request Status"="*" Level="*" | rename Level as Complexity |transaction TicketNumber startswith="'Request Status'=Open*" endswith="('Request Status'=Resolved OR 'Request Status'=Closed)" | stats sum(duration) as TimeOpen by Complexity 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may have to tweak the single quotes/double quotes to get it working. I personally prefer field names with underscores in lieu of spaces, and then I just do a rename with spaces at the end. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251283#M75089</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2016-01-28T23:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251284#M75090</link>
      <description>&lt;P&gt;I'm assuming you wish to determine the time between a ticket was first opened (or some other specific status from which it was in an initial or specific state until it reached the 'Resolved' or 'Closed' state) - correct?&lt;/P&gt;

&lt;P&gt;Try combining the events for the ticket into a transaction that spans a beginning state to the end state of 'Resolved' or 'Closed'.&lt;/P&gt;

&lt;P&gt;Here is an example of a answers question where the person looking for a solution that was resolved by creating a transaction between a start/end state within the data they were reporting on:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/46503/calculate-time-difference-between-2-events.html"&gt;https://answers.splunk.com/answers/46503/calculate-time-difference-between-2-events.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251284#M75090</guid>
      <dc:creator>pgreer_splunk</dc:creator>
      <dc:date>2016-01-28T23:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251285#M75091</link>
      <description>&lt;P&gt;Hi jhoang,&lt;/P&gt;

&lt;P&gt;I assume &lt;CODE&gt;Start Time&lt;/CODE&gt; as the time when the ticket was created and &lt;CODE&gt;_time&lt;/CODE&gt; as the time when the ticket was closed or resolved.&lt;BR /&gt;
Can you try the below query?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sdp Department="*" "Request Status"=Closed OR "Request Status"=Resolved Level="*" | rename Level as Complexity | eval ticketCreated=strptime('Start Time',"%Y-%m-%dT%H:%M:%S.%3N-%z") | eval ticketClosed=strptime('_time',"%Y-%m-%dT%H:%M:%S.%3N-%z") | eval ResolutionTime = ticketClosed - ticketCreated | stats avg(ResoultionTime) by Complexity
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251285#M75091</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-01-28T23:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251286#M75092</link>
      <description>&lt;P&gt;Hey, &lt;/P&gt;

&lt;P&gt;I tried the above query but it does not return any results. I am comfortable with the suggestion you provided in regards to the field names with underscores, how would the new query look instead? &lt;/P&gt;

&lt;P&gt;What is the difference between the single and double quotes? &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:40:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251286#M75092</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-28T23:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251287#M75093</link>
      <description>&lt;P&gt;Hi Murali,&lt;/P&gt;

&lt;P&gt;so the query returned the results, however the avg(Resolution Time) is blank, and there is also a complexity field with the name not assigned. &lt;/P&gt;

&lt;P&gt;When I try to pull the single value chart, I only receive the word "intensive"&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:42:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251287#M75093</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-28T23:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251288#M75094</link>
      <description>&lt;P&gt;the rename command should be &lt;CODE&gt;rename Level AS Complexity&lt;/CODE&gt;. &lt;BR /&gt;
Can you try that?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251288#M75094</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-01-28T23:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251289#M75095</link>
      <description>&lt;P&gt;same results&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251289#M75095</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-28T23:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251290#M75096</link>
      <description>&lt;P&gt;should I be replacing ticketClosed - ticketCreated with:&lt;/P&gt;

&lt;P&gt;Resolved Time - Created Time and &lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:51:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251290#M75096</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-28T23:51:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251291#M75097</link>
      <description>&lt;P&gt;if you would like to have four different single value chart for each Complexity, then you would need to have four search queries. I think you cannot produce four single value charts with one query. &lt;/P&gt;

&lt;P&gt;In this case, the single value chart is taking the first value.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jan 2016 23:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251291#M75097</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-01-28T23:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251292#M75098</link>
      <description>&lt;P&gt;Okay that I under, so I would update the query &lt;/P&gt;

&lt;P&gt;with the following? &lt;/P&gt;

&lt;P&gt;by Complexity="Intensive"&lt;/P&gt;

&lt;P&gt;The query you provided initially provided the correct breakdown, however there was just no information/ data for avg(ResolutionTime) for either of the complexity. That field was blank  &lt;/P&gt;

&lt;P&gt;ex.&lt;/P&gt;

&lt;P&gt;Intensive|blank&lt;BR /&gt;
Intermediate|blank&lt;BR /&gt;
Moderate|blank&lt;BR /&gt;
Minimal|blank&lt;BR /&gt;
Not assigned|blank&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 00:00:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251292#M75098</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-01-29T00:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251293#M75099</link>
      <description>&lt;P&gt;Single quotes can be used to quote field names with spaces. I use them during an eval. e.g. &lt;BR /&gt;
&lt;CODE&gt;| eval MyField = 'some other field'&lt;/CODE&gt; will treat 'some other field' as an actual field name. Whereas, &lt;CODE&gt;| eval MyField = "some other field"&lt;/CODE&gt; will set MyField to the literal string of "some other field"&lt;/P&gt;

&lt;P&gt;I made up the TicketNumber field. I assume there is one in your events, or some other ID that you can key off of? Change it to that field name.&lt;/P&gt;

&lt;P&gt;If you redo your field extractions with underscores, it would look something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=sdp Department="*" "Request Status"="*" Level="*" | rename Level as Complexity |transaction TicketNumber startswith=(Request Status=Open*) endswith=(Request_Status=Resolved OR Request_Status=Closed) | stats sum(duration) as TimeOpen by Complexity 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See also: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Identifyandgroupeventsintotransactions#Transaction_search_options"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.3/Search/Identifyandgroupeventsintotransactions#Transaction_search_options&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 00:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251293#M75099</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2016-01-29T00:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251294#M75100</link>
      <description>&lt;P&gt;This would probably due to eval expression.&lt;/P&gt;

&lt;P&gt;Two things you need to check.&lt;BR /&gt;
 1. The timeformat for both &lt;CODE&gt;Start Time&lt;/CODE&gt; and &lt;CODE&gt;_time&lt;/CODE&gt; are &lt;CODE&gt;"%Y-%m-%dT%H:%M:%S.%3N-%z"&lt;/CODE&gt;. If not please modify the format accordingly, so that the strptime can convert it into correct epoch time.&lt;BR /&gt;
 2. Remove single quotes in the eval expression as below.&lt;BR /&gt;
    | eval ticketCreated=strptime(StartTime,"%Y-%m-%dT%H:%M:%S.%3N-%z") | eval ticketClosed=strptime(_time,"%Y-%m-%dT%H:%M:%S.%3N-%z")&lt;/P&gt;

&lt;P&gt;The time variable in the strptime must not be quoted. Apologies for multiple changes. &lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2016 01:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251294#M75100</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-01-29T01:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251295#M75101</link>
      <description>&lt;P&gt;Hi Murali,&lt;/P&gt;

&lt;P&gt;So I was able to capture the resolution time based on Complexity. However when I run my current search command, it displays the value's in a weird method.&lt;/P&gt;

&lt;P&gt;Is there a way to display the value in an easier format such as 2Days 8 Hours and 30 Minutes?&lt;/P&gt;

&lt;P&gt;Search below:&lt;/P&gt;

&lt;P&gt;index=sdp Department="*" "Request Status"=Closed OR "Request Status"=Resolved Level="Intensive" | rename Level as Complexity | eval ticketCreated=_time | eval ticketClosed=strptime('Resolved Time',"%b %d,%Y %I:%M %p") |  eval Averagetime1=ticketClosed-ticketCreated | stats avg(Averagetime1) as timeVariable by Complexity | fieldformat timeVariable = tostring(timeVariable,"duration")&lt;/P&gt;

&lt;P&gt;Value display is:&lt;BR /&gt;
@+08:30:30.000000&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 23:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251295#M75101</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-02-01T23:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251296#M75102</link>
      <description>&lt;P&gt;Hi Jhoang,&lt;/P&gt;

&lt;P&gt;You can use the below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | eval timeVariable=tostring(totalVariable,"duration") | eval TimeTaken = replace(timeVariable,"(\d*)\+(\d*)\:(\d+)\:(\d+)\.(\d+)","\1Days \2Hours \3Minutes \4Seconds")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2016 00:04:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251296#M75102</guid>
      <dc:creator>Murali2888</dc:creator>
      <dc:date>2016-02-02T00:04:55Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251297#M75103</link>
      <description>&lt;P&gt;I was able to figure this out, ty&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 20:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251297#M75103</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-02-02T20:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I edit my search to calculate Ticket Resolution Time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251298#M75104</link>
      <description>&lt;P&gt;I was able to figure this out ty&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 20:17:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-edit-my-search-to-calculate-Ticket-Resolution-Time/m-p/251298#M75104</guid>
      <dc:creator>jhoang</dc:creator>
      <dc:date>2016-02-02T20:17:04Z</dc:date>
    </item>
  </channel>
</rss>

