I am new to kibana and elastic search, i want a metrics for average , total , longest of the timespans generated by taking difference of max and min timestamp fields. First I got min and max timestamps from the visualization of data table in Kibana ,in which 2 metrics (min @timestamp, max @timestamp) are there having the aggregation of top hit and size 1 respectively, one is ascending (min timestamp) and the other descending(max timestamp). I also have a bucket with split rows which is grouping my data by the field contactId
.My log data is like
{
"contactId":"XXXXX",
"TimeStamp":"XXXXX"
}