Dashboards & Visualizations

How to calculate the age of the tickets ?

chitreshakumar
Communicator

I want to add a panel which will show the age of the tickets .
I have start time ,finish time and will take current time for those tickets whose finish time is null .So basically age is difference of finish and start time .How to apply this in Splunk?

0 Karma

p_gurav
Champion

Hi,

Try this:

| eval finishtime_new = case(isnull(finishtime), currenttime) | eval finishtime_epoch = (finishtime_new, "format_of_finishtime_new") | eval starttime_epoch = (starttime, "format_of_startime") | eval diff = finishtime_epoch - starttime_epoch

0 Karma

p_gurav
Champion

Hi chitreshakumar,

you can convert starttime and finishtime in epoch usingstrptime function using eval:
| eval finishtime_epoch = (finishtime, "") | eval starttime_epoch = (starttime, "") | eval diff = finishtime_epoch - starttime_epoch

0 Karma

chitreshakumar
Communicator

there is one condition if the finish time is not defined or null then this query will give wrong answer

0 Karma

p_gurav
Champion

You can make new field :

| eval finishtime_new = case(isnull(finishtime), currenttime)

0 Karma

mayurr98
Super Champion

give us sample format of starttime and finishtime

0 Karma

chitreshakumar
Communicator

its the date and time of the ticket generated

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...