# Rollup job issue with wrong time values(v 6.7.1)

**URL:** <https://discuss.elastic.co/t/rollup-job-issue-with-wrong-time-values-v-6-7-1/195570>\
**Category:** Elasticsearch\
**Created:** [August 16, 2019, 10:04pm UTC](https://discuss.elastic.co/t/rollup-job-issue-with-wrong-time-values-v-6-7-1/195570 "2019-08-16T22:04:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhruv477](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dhruv477](https://discuss.elastic.co/u/dhruv477)\
**Post date:** [August 16, 2019, 10:04pm UTC](https://discuss.elastic.co/t/rollup-job-issue-with-wrong-time-values-v-6-7-1/195570/1 "2019-08-16T22:04:54Z")

</div>

Our business problem is to find the duration of a session, and our sample simplified data set is a simple table with 2 columns - request\_date and session\_id. All we need is to find the max(request\_date), min(request\_date) and subtract them.

 ![08%20PM](https://us1.discourse-cdn.com/elastic/original/3X/f/7/f7aa8e7436238e49ff8cccd3bd5968d017f11b67.png)  
We create Rollup Jobs and in **Terms** , we choose session\_id and **Metric** , we choose min and max of request\_date and we try querying it in Dev Tools

The actual values of min, max (in epoch) are 1565744459000,1565744505000  
and values of min, max returned from rollup are 1565744431104,1565744562176.

So a 46.000 sec duration, became 131.072 secs.

Can someone explain why this really weird discrepancy occurs while using Rollup Jobs?

There's also a difference in what \_source returns and what docvalue\_fields returns(as seen the picture below in request.date.min.value, request.date.max.value)

> {  
> "\_index" : "1234\_rollup",  
> "\_type" : "\_doc",  
> "\_id" : "1234\_rollup$oLCd6lhqSwUI\_dCTGrgYgA",  
> "\_score" : null,  
> "\_source" : {  
> "request\_date.max.value" : **1.565744505E12** ,  
> "request\_date.min.value" : **1.565744459E12** ,  
> "\_rollup.version" : 2,  
> "request\_date.date\_histogram.\_count" : 4,  
> "request\_date.date\_histogram.time\_zone" : "UTC",  
> "session\_id.terms.\_count" : 4,  
> "request\_date.date\_histogram.timestamp" : 1565740800000,  
> "request\_date.date\_histogram.interval" : "24h",  
> "session\_id.terms.value" : "07a954ff-186f-45f9-9bc4-8b53b1613580",  
> "\_rollup.id" : "1234\_rollup"  
> },  
> "fields" : {  
> "request\_date.max.value" : [  
> **1.565744562176E12**  
> ],  
> "request\_date.min.value" : [  
> **1.565744431104E12**  
> ]  
> }

---

<div class="post-metadata">

**Author:** ![dhruv477](https://avatars.discourse-cdn.com/v4/letter/d/94ad74/32.png) [@dhruv477](https://discuss.elastic.co/u/dhruv477)\
**Post date:** [August 21, 2019, 9:42pm UTC](https://discuss.elastic.co/t/rollup-job-issue-with-wrong-time-values-v-6-7-1/195570/2 "2019-08-21T21:42:03Z")

</div>

Any help would be really appreciated.

---

<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 18, 2019, 9:42pm UTC](https://discuss.elastic.co/t/rollup-job-issue-with-wrong-time-values-v-6-7-1/195570/3 "2019-09-18T21:42:07Z")

</div>

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