# Datafeed frequency must be a multiple of the aggregation interval

**URL:** <https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [March 21, 2018, 10:58am UTC](https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968 "2018-03-21T10:58:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tvannet](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@tvannet](https://discuss.elastic.co/u/tvannet)\
**Post date:** [March 21, 2018, 10:58am UTC](https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968/1 "2018-03-21T10:58:49Z")

</div>

After upgrading from 5.x to 6.x, I am getting the following error for some ML jobs:

> Datafeed frequency must be a multiple of the aggregation interval

The bucket span is set to 900s and the datafeed frequency is 450s. Clearly, the error says it should be the other way around.

However, this used to work in 5.x and the documentation suggests it still should : [Datafeed Resources | Elasticsearch Reference [6.2] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/ml-datafeed-resource.html#ml-datafeed-resource)

> `frequency`  
> (time units) The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`.

Is the documentation outdated or am I reading it wrong ? My undestanding was that the frequency parameter was used to get partial results without waiting for the full bucket span.

Thanks,

Thomas

---

<div class="post-metadata">

**Author:** ![dmitri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dmitri/32/17997_2.png) [@dmitri](https://discuss.elastic.co/u/dmitri)\
**Post date:** [March 23, 2018, 11:01am UTC](https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968/2 "2018-03-23T11:01:12Z")

</div>

Hi Thomas,

The error does not refer to the relationship of the `frequency` with the `bucket_span` but instead that of the `frequency` with the aggregation interval. Datafeeds may be configured to use aggregations. Jobs created through the single-metric wizard make use of that feature.

To fix the issue, in the job management page, expand the job in question and click on the JSON tab. In the JSON, find the `datafeed_config` section. In there, you will see a `date_histogram` aggregation. Observe the value of the `interval` field. Frequency needs to be a multiple of that value. You can then edit the job by going back to the job management page and clicking the `edit job` button for the job in question. Then, in the datafeed tab, you can update the frequency accordingly.

---

<div class="post-metadata">

**Author:** ![tvannet](https://avatars.discourse-cdn.com/v4/letter/t/90ced4/32.png) [@tvannet](https://discuss.elastic.co/u/tvannet)\
**Post date:** [March 23, 2018, 12:29pm UTC](https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968/3 "2018-03-23T12:29:48Z")

</div>

I see, thanks for the information!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 30, 2018, 10:21pm UTC](https://discuss.elastic.co/t/datafeed-frequency-must-be-a-multiple-of-the-aggregation-interval/124968/4 "2018-10-30T22:21:31Z")

</div>


