Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filebeat modules: Machine learning jobs #4506

Merged
merged 1 commit into from
Jun 23, 2017

Conversation

tsg
Copy link
Contributor

@tsg tsg commented Jun 15, 2017

This adds support for loading ML configurations (job + datafeed) from the filebeat modules. An example ML configuration is added to the Nginx Filebeat module. This sample applies ML anomaly detection on the response codes.

The loading is implemented as part of the setup command and part of the --setup flag.

If a job configuration with the same ID exists, it is not overwritten, because deleting jobs could potentially delete user data. The user should manually delete the jobs in the UI if they want to upgrade.

ToDOs for the overall implementation:

  • Implement the jobs loading support in libbeat
  • Read the jobs configurations from the filesets
  • Add xpack to default testing env (snaphost.yml)
  • system tests
  • Docs & changelog

@tsg tsg added Filebeat Filebeat in progress Pull request is currently in progress. review labels Jun 15, 2017
@tsg
Copy link
Contributor Author

tsg commented Jun 20, 2017

I pushed everything, but I expect the test to be failing until the Kibana snapshots are fixed (there's an issue with the current ones). But should be otherwise ready for reviews.

@tsg tsg removed the in progress Pull request is currently in progress. label Jun 20, 2017
@tsg
Copy link
Contributor Author

tsg commented Jun 20, 2017

Also, I'm leaving docs for later, since this will mainly mean document the setup command.

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM in general, but some tests are failing, looks legit, you may want to take a look to them

@@ -66,8 +67,14 @@ func New(b *beat.Beat, rawConfig *common.Config) (beat.Beater, error) {
}
}

// In the setup command,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spurious comment?

@tsg tsg force-pushed the machine_learning_jobs branch 2 times, most recently from 0b9286e to 3c04b7f Compare June 23, 2017 09:03
This adds support for loading ML configurations (job + datafeed) from the filebeat modules.
An example ML configuration is added to the Nginx Filebeat module. This sample applies
ML anomaly detection on the response codes.

The loading is implemented as part of the `setup` command and part of the `--setup` flag.

If a job configuration with the same ID exists, it is not overwritten, because deleting jobs
could potentially delete user data. The user should manually delete the jobs in the UI if they
want to upgrade.
@tsg tsg force-pushed the machine_learning_jobs branch from 3c04b7f to 68641f6 Compare June 23, 2017 12:08
@tsg
Copy link
Contributor Author

tsg commented Jun 23, 2017

Squashed and rebased. Remaining test failures seem unrelated, but I'm hoping for some more green on this run.

@tsg tsg added needs_backport PR is waiting to be backported to other branches. v5.6.0 labels Jun 23, 2017
@exekias
Copy link
Contributor

exekias commented Jun 23, 2017

💯 tested by hand, it adds the job both with filebeat setup and filebeat run -setup. Just one note, the job is not started after adding it, so the user still has to start the job by herself

@exekias exekias merged commit 1213483 into elastic:master Jun 23, 2017
@@ -0,0 +1,44 @@
{
"job_id": "JOB_ID",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only skimmed through the PR but this kind of looked fishy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it gets replaced in code with a generated job id. Didn't know how to reflect this otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, I don't mean a textual replacement. The json gets decoded and the key replaced.

@tsg tsg added the needs_docs label Jun 30, 2017
@tsg tsg removed the needs_backport PR is waiting to be backported to other branches. label Jun 30, 2017
tsg added a commit to tsg/beats that referenced this pull request Jun 30, 2017
This adds support for loading ML configurations (job + datafeed) from the filebeat modules.
An example ML configuration is added to the Nginx Filebeat module. This sample applies
ML anomaly detection on the response codes.

The loading is implemented as part of the `setup` command and part of the `--setup` flag.

If a job configuration with the same ID exists, it is not overwritten, because deleting jobs
could potentially delete user data. The user should manually delete the jobs in the UI if they
want to upgrade.
(cherry picked from commit 1213483)
monicasarbu pushed a commit that referenced this pull request Jul 3, 2017
)

* Filebeat modules: Machine Learning jobs (#4506)

This adds support for loading ML configurations (job + datafeed) from the filebeat modules.
An example ML configuration is added to the Nginx Filebeat module. This sample applies
ML anomaly detection on the response codes.

The loading is implemented as part of the `setup` command and part of the `--setup` flag.

If a job configuration with the same ID exists, it is not overwritten, because deleting jobs
could potentially delete user data. The user should manually delete the jobs in the UI if they
want to upgrade.
(cherry picked from commit 1213483)

* use 5.5 snapshots for now

* Adjusted test for 5.x

* Another test adjustments

* On a 400 response on _xpack, assume that Xpack is not installed

* Another test fix
@tsg tsg mentioned this pull request Jul 17, 2017
4 tasks
@dedemorton dedemorton mentioned this pull request Jul 25, 2017
42 tasks
@dedemorton dedemorton mentioned this pull request Dec 14, 2017
37 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants