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?
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
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
there is one condition if the finish time is not defined or null then this query will give wrong answer
You can make new field :
| eval finishtime_new = case(isnull(finishtime), currenttime)
give us sample format of starttime and finishtime
its the date and time of the ticket generated