# Aggregation of single jobs in machine learning

**URL:** <https://discuss.elastic.co/t/aggregation-of-single-jobs-in-machine-learning/85026>\
**Category:** Elasticsearch\
**Created:** [May 9, 2017, 7:44am UTC](https://discuss.elastic.co/t/aggregation-of-single-jobs-in-machine-learning/85026 "2017-05-09T07:44:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emmanuel](https://avatars.discourse-cdn.com/v4/letter/e/3e96dc/32.png) [@Emmanuel](https://discuss.elastic.co/u/Emmanuel)\
**Post date:** [May 9, 2017, 7:44am UTC](https://discuss.elastic.co/t/aggregation-of-single-jobs-in-machine-learning/85026/1 "2017-05-09T07:44:51Z")

</div>

I would like to aggregate or to consolidate different single jobs or multiple jobs in order to correlate different issues I could have for one application.  
What I would like to do is:

- One multiple jobs based on performance metrics for 5 servers of my application (Inside the index metricbeat)
- One multiple jobs based on error in the logs for 5 servers of my applications (Inside the index filebeat)
- One single job based on the usage of my applications (Inside the index filebeat)

The objective is to have alert just only if I have at least two issues (one related to usage and one related to one server capacity).  
How can I consolidate different jobs to send notification just if I have different issues correlated?

---

<div class="post-metadata">

**Author:** ![droberts195](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/droberts195/32/17692_2.png) [@droberts195](https://discuss.elastic.co/u/droberts195)\
**Post date:** [May 9, 2017, 8:58am UTC](https://discuss.elastic.co/t/aggregation-of-single-jobs-in-machine-learning/85026/2 "2017-05-09T08:58:50Z")

</div>

Hi,

This is the sort of functionality we're looking to make much more accessible in a future release.

It is possible today if you're prepared to create some complicated watches, but in the future we'll add a wrapper so that you don't have to create the watch directly.

Here are some clues if you want to try and use watcher with ML in 5.4:

- By default ML results are stored in an index called `.ml-anomalies-shared`, so unless you changed this then the results from all 3 of your jobs will be in there
- The results have a field `job_id` which indicates which job they came from, plus a `timestamp` that indicates which bucketed time period they relate to
- There are different types of results, indicated by the `result_type` field
- If you want to alert when any two jobs have overall anomalies at the same time then you want to look for the `anomaly_score` field being greater than some threshold (say 75) when `result_type` is `bucket`, and alert when there are two results found with the same or similar `timestamp`s

Basically it is possible, but unless you're a watcher expert you may prefer to wait until we add functionality to automate the watch setup.

---

<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:** [June 6, 2017, 9:01am UTC](https://discuss.elastic.co/t/aggregation-of-single-jobs-in-machine-learning/85026/3 "2017-06-06T09:01:13Z")

</div>

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