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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...