# How to get Average of 2 timestamp in Kibana metric visualization

**URL:** https://discuss.elastic.co/t/how-to-get-average-of-2-timestamp-in-kibana-metric-visualization/340616
**Category:** Kibana
**Tags:** elastic-stack-security
**Created:** [August 11, 2023, 6:33am UTC](https://discuss.elastic.co/t/how-to-get-average-of-2-timestamp-in-kibana-metric-visualization/340616 "2023-08-11T06:33:19Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yash\_mangla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yash_mangla/32/25889_2.png) [@yash\_mangla](https://discuss.elastic.co/u/yash_mangla)
#### Post date: [August 11, 2023, 6:33am UTC](https://discuss.elastic.co/t/how-to-get-average-of-2-timestamp-in-kibana-metric-visualization/340616/1 "2023-08-11T06:33:19Z")

</div>

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.

```auto
{
  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

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

```

---

<div class="post-metadata">

### Author: ![Soucy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/soucy/32/119756_2.png) [@Soucy](https://discuss.elastic.co/u/Soucy)
#### Post date: [August 29, 2023, 5:26pm UTC](https://discuss.elastic.co/t/how-to-get-average-of-2-timestamp-in-kibana-metric-visualization/340616/2 "2023-08-29T17:26:21Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [September 26, 2023, 5:26pm UTC](https://discuss.elastic.co/t/how-to-get-average-of-2-timestamp-in-kibana-metric-visualization/340616/3 "2023-09-26T17:26:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
