How to get Average of 2 timestamp in Kibana metric visualization

Hi Team,

I want to create a metric visualization with average difference showing for entire records. and every record is having multiple timestamp. So, we want to show average difference between start_time and acknoeledge_time.

Can anyone please suggest how should we go about it. i have already mapped all the fields with date type using elastic index mapping

for example: lets say below is 1 record. similarly we have multiple records in index. but don't want linechart or barchart. but a single metric text showing average difference between two timestamp across all records in index.

{
  acknowledged time:  2022-12-09 08:14:18.248000
  closed time:  2022-12-09 08:14:45.999000
  created_at time:  2022-12-08 18:55:51.566000      
  end_timestamp time:  2022-12-08 18:16:07
  modified_at time:  2022-12-09 08:14:09.715000     
  start_timestamp time:  2022-12-08 18:16:07        
  modified_at_auto time:  2022-12-08 18:55:51.662000
}

below is the raw record

{
    "acknowledged":1670553858248,
    "closed":1670553885999,
    "created_at":1670505951566,
    "end_timestamp":1670503567000,
    "modified_at_auto":1670505951662,
    "modified_at":1670553849715,
    "start_timestamp":1670503567000,
}

Hi @yash_mangla. As your question is regarding how to create a specific type of visualization, you may want to remove the elastic-stack-security tag and add the visualisation tag instead. This may give it better visibility.