# Time Series Moving Average not working properly

**URL:** https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863
**Category:** Kibana
**Created:** [June 24, 2016, 8:28am UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863 "2016-06-24T08:28:56Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)
#### Post date: [June 24, 2016, 8:28am UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/1 "2016-06-24T08:28:56Z")

</div>

I have used timeseries in kibana to generate some graphs, however, it seems that it is not generating proper result when I use with moving average.

As from the graph, the index will become 0 afterall, which should be the way how moving average should be presented. Rather than become 0, the line should remain at the point of 5

 ![](https://us1.discourse-cdn.com/elastic/original/2X/9/965ce10153c4f10e1151b7a3452aebf225dd6811.PNG)

Is there any problem with the moving average part?

Also, when I try to split chart into separate lines, it could not show proper result.

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3d441b157d8e5108be8563b754e0f7352352dfd3.PNG)

Is that a limitation of timelion if data is too much?

---

<div class="post-metadata">

### Author: ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)
#### Post date: [June 24, 2016, 12:16pm UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/2 "2016-06-24T12:16:14Z")

</div>

This link gives you all parameters used in timelion. [https://github.com/elastic/timelion/blob/master/FUNCTIONS.md](https://github.com/elastic/timelion/blob/master/FUNCTIONS.md)  
Maybe it is related to timefield

---

<div class="post-metadata">

### Author: ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)
#### Post date: [June 24, 2016, 12:30pm UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/3 "2016-06-24T12:30:55Z")

</div>

I have read this but still could not understand what do you mean by it is related to timefield data. How it is affected

---

<div class="post-metadata">

### Author: ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)
#### Post date: [June 24, 2016, 12:35pm UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/4 "2016-06-24T12:35:00Z")

</div>

In timelion, the field time per default is @timestamp. If you want to do something regarding another time field defined in your log. You have to specify it .  
Actually, I had this trouble one time and iwas getting graph like you've got.

---

<div class="post-metadata">

### Author: ![Kennedy\_Kan1](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Kennedy\_Kan1](https://discuss.elastic.co/u/Kennedy_Kan1)
#### Post date: [June 24, 2016, 3:43pm UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/5 "2016-06-24T15:43:39Z")

</div>

But I have already mapped the item with date filter in order to change the @timestamp equals to my timefield.

---

<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: [July 6, 2017, 1:49pm UTC](https://discuss.elastic.co/t/time-series-moving-average-not-working-properly/53863/6 "2017-07-06T13:49:20Z")

</div>


