# Date Operations on Kibana / Timelion

**URL:** <https://discuss.elastic.co/t/date-operations-on-kibana-timelion/142715>\
**Category:** Kibana\
**Tags:** timelion\
**Created:** [August 2, 2018, 8:22am UTC](https://discuss.elastic.co/t/date-operations-on-kibana-timelion/142715 "2018-08-02T08:22:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mbadji](https://avatars.discourse-cdn.com/v4/letter/m/a8b319/32.png) [@Mbadji](https://discuss.elastic.co/u/Mbadji)\
**Post date:** [August 2, 2018, 8:22am UTC](https://discuss.elastic.co/t/date-operations-on-kibana-timelion/142715/1 "2018-08-02T08:22:52Z")

</div>

Hi all,

So I am visualising (using Kibana) some NetFlow data stored in my Elasticsearch instance.  
My interest is on two date fields : **netflow.first\_switched and netflow.last\_switched** et I aim to plot the actual throughput in my network (Timelion).

Is there any way to perform a substract operation between these 2 date fields ? in Kibana or Elasticsearch.

Thank you for your answers

---

<div class="post-metadata">

**Author:** ![rcowart](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rcowart/32/88091_2.png) [@rcowart](https://discuss.elastic.co/u/rcowart)\
**Post date:** [August 4, 2018, 10:30am UTC](https://discuss.elastic.co/t/date-operations-on-kibana-timelion/142715/2 "2018-08-04T10:30:09Z")

</div>

Dates are stored as milliseconds since epoch, so it is simple subtraction to get the duration of the flow in milliseconds.

However that isn't really the best way to calculate rates in Kibana. I recommend you take a look at ElastiFlow ([https://github.com/robcowart/elastiflow](https://github.com/robcowart/elastiflow)) and see how it does it using calculations with TSVB.

---

<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 1, 2018, 10:30am UTC](https://discuss.elastic.co/t/date-operations-on-kibana-timelion/142715/3 "2018-09-01T10:30:13Z")

</div>

Closed on September 1, 2018, 10:30am UTC

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