# Duration time between logs

**URL:** <https://discuss.elastic.co/t/duration-time-between-logs/329757>\
**Category:** Logs\
**Created:** [April 11, 2023, 2:53pm UTC](https://discuss.elastic.co/t/duration-time-between-logs/329757 "2023-04-11T14:53:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justme123](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@justme123](https://discuss.elastic.co/u/justme123)\
**Post date:** [April 11, 2023, 2:53pm UTC](https://discuss.elastic.co/t/duration-time-between-logs/329757/1 "2023-04-11T14:53:02Z")

</div>

Hi Everyone !  
I'm new to elastic and kibana and I have some troubles with duration time between log event.

I have 2 logs that i get via SNMP Trap :

1. 

```auto
referenceNumber : 123456
alarmType: 2
@timestamp : 2023-04-11T09:00:00.091Z

```

1. 

```auto
referenceNumber : 123456
alarmType: 3
@timestamp : 2023-04-11T09:00:45.091Z

```

Those logs represent event from other software.  
`alarmType:2` start event  
`alarmType:3` end event  
I need to calculate the time of that event. Is that possible ?

---

<div class="post-metadata">

**Author:** ![willemdh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/willemdh/32/16922_2.png) [@willemdh](https://discuss.elastic.co/u/willemdh)\
**Post date:** [April 11, 2023, 8:17pm UTC](https://discuss.elastic.co/t/duration-time-between-logs/329757/2 "2023-04-11T20:17:33Z")

</div>

Hello @justme123

THis is not possible with only Kibana I think. A requirement would be to somehow add event.duration at ingest time. For example in Logstash you can add an elasticsearch filter with which you could theoreticaloly query Elasticsearch for a doc with the same ReferenceNumber (if this is a usable number of course). Then you calculate the difference between the currently ingested @timestamp and the @timestamp of the doc you would get from your query.

Grtz

Willem

---

<div class="post-metadata">

**Author:** ![justme123](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@justme123](https://discuss.elastic.co/u/justme123)\
**Post date:** [April 12, 2023, 5:54am UTC](https://discuss.elastic.co/t/duration-time-between-logs/329757/3 "2023-04-12T05:54:21Z")

</div>

I wonder if Elpased plugin could solve my problem

---

<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:** [May 10, 2023, 5:55am UTC](https://discuss.elastic.co/t/duration-time-between-logs/329757/4 "2023-05-10T05:55:14Z")

</div>

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