# Event.start value minus Event.start last value code

**URL:** <https://discuss.elastic.co/t/event-start-value-minus-event-start-last-value-code/333374>\
**Category:** Kibana\
**Created:** [May 14, 2023, 8:03am UTC](https://discuss.elastic.co/t/event-start-value-minus-event-start-last-value-code/333374 "2023-05-14T08:03:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![patterno](https://avatars.discourse-cdn.com/v4/letter/p/5e9695/32.png) [@patterno](https://discuss.elastic.co/u/patterno)\
**Post date:** [May 14, 2023, 8:03am UTC](https://discuss.elastic.co/t/event-start-value-minus-event-start-last-value-code/333374/1 "2023-05-14T08:03:25Z")

</div>

Good day!

I am new to elastic and I'm wondering if any other users can help me with my problem. I am having a trouble computing the event.start and event.start (last value) of a certain process on my logs. I am planning to add a runtime field to the data view. I can get the value of my event.start but I dont know the code for the event.start last value. If there are any other way to solve this problem, I'll gladly appreciate. Thank you

---

<div class="post-metadata">

**Author:** ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)\
**Post date:** [May 31, 2023, 11:44pm UTC](https://discuss.elastic.co/t/event-start-value-minus-event-start-last-value-code/333374/2 "2023-05-31T23:44:31Z")

</div>

Hi, I assume by "event.start last value," you mean a value of the `event.start` field that exists in the document with the most recent timestamp.

Unfortunately, runtime fields only work across fields of a single document. If you need a calculation that involves awareness of an external document, you'll need to get that in a query and capture that value.

Which application are you using for your processing? This kind of calculation can be done in Canvas, with the `essql` and `var_set` functions:  
[https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#essql\_fn](https://www.elastic.co/guide/en/kibana/current/canvas-function-reference.html#essql_fn)

---

<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:** [June 28, 2023, 11:45pm UTC](https://discuss.elastic.co/t/event-start-value-minus-event-start-last-value-code/333374/3 "2023-06-28T23:45:13Z")

</div>

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