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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...