# How do I use \_xpack/ml/datafeeds API?

**URL:** <https://discuss.elastic.co/t/how-do-i-use-xpack-ml-datafeeds-api/177700>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-machine-learning\
**Created:** [April 20, 2019, 9:26am UTC](https://discuss.elastic.co/t/how-do-i-use-xpack-ml-datafeeds-api/177700 "2019-04-20T09:26:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![blueren](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@blueren](https://discuss.elastic.co/u/blueren)\
**Post date:** [April 20, 2019, 9:26am UTC](https://discuss.elastic.co/t/how-do-i-use-xpack-ml-datafeeds-api/177700/1 "2019-04-20T09:26:28Z")

</div>

I have a few ML jobs. I would like to start them pragmatically. The [docs](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/ml-start-datafeed.html) suggest the use of the below API.

I would like to start at the beginning of data, and let it continue forever (no real end time)  
What should be my start / stop / timeout parameters in this case?

```
POST _xpack/ml/datafeeds/datafeed-dns-rate-and-size/_start
{
  "start": "",
  "stop": "",
  "timeout": ""
}
```

---

<div class="post-metadata">

**Author:** ![richcollier](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/richcollier/32/115035_2.png) [@richcollier](https://discuss.elastic.co/u/richcollier)\
**Post date:** [April 20, 2019, 9:37pm UTC](https://discuss.elastic.co/t/how-do-i-use-xpack-ml-datafeeds-api/177700/2 "2019-04-20T21:37:32Z")

</div>

Just specify a start time that is earlier than your earliest timestamp of the dataset and do not specify a stop time. For example:

`POST /_xpack/ml/datafeeds/datafeed-asamplejob/_start?start=2018-01-01T00:00:00Z`

---

<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:** [May 18, 2019, 9:37pm UTC](https://discuss.elastic.co/t/how-do-i-use-xpack-ml-datafeeds-api/177700/3 "2019-05-18T21:37:39Z")

</div>

Closed on May 18, 2019, 9:37pm UTC

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