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!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...