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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...