Splunk Search

Calculating Average Time Span

capri1231
New Member

I am having problems calculating an average time span. I need to determine how log it takes for a technician to "acknowledge" a ticket when it is created by the Help Desk.

source="servername" Assignee="*" GroupName="TierII" OR GroupName="TierIII" 
| stats min(DateTimeAssign) AS begin max(DateTimeAcknow) AS end by CallID,GroupName,Assignee,Priority 
| eval duration=round(end-begin) | eval hours=duration/3600 | eval minutes=round(duration/60) 
| eval Created=strftime(begin," %b %d, %Y %T %p") 
| eval Closed=strftime(end," %b %d, %Y %T %p")
| chart avg(hours) values(CallID) values(Created) as Assigned values(Closed) as Ack values(minutes) over GroupName 
Tags (1)
0 Karma

lguinn2
Legend

Try this

source="servername" Assignee="*" GroupName="TierII" OR GroupName="TierIII" 
| stats min(DateTimeAssign) AS begin max(DateTimeAcknow) AS end by CallID,GroupName,Assignee,Priority 
| eval duration=round(end-begin) 
| eval Created=strftime(begin," %b %d, %Y %T %p") 
| eval Closed=strftime(end," %b %d, %Y %T %p")
| stats avg(duration) as avgDuration values(CallID) values(Created) as Assigned values(Closed) as Ack by GroupName
| fieldformat avgDuration = tostring(avgDuration,"duration")
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...