forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filebeat modules: Machine Learning jobs (elastic#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.
- Loading branch information
Showing
19 changed files
with
533 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
filebeat/module/nginx/access/machine_learning/datafeed_response_code.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"query_delay": "60s", | ||
"frequency": "60s", | ||
"indexes": [ | ||
"filebeat-*" | ||
], | ||
"types": [ | ||
"_default_", | ||
"log" | ||
], | ||
"query": { | ||
"match_all": { | ||
"boost": 1 | ||
} | ||
}, | ||
"aggregations": { | ||
"buckets": { | ||
"date_histogram": { | ||
"field": "@timestamp", | ||
"interval": 3600000, | ||
"offset": 0, | ||
"order": { | ||
"_key": "asc" | ||
}, | ||
"keyed": false, | ||
"min_doc_count": 0 | ||
}, | ||
"aggregations": { | ||
"@timestamp": { | ||
"max": { | ||
"field": "@timestamp" | ||
} | ||
}, | ||
"nginx.access.response_code": { | ||
"terms": { | ||
"field": "nginx.access.response_code", | ||
"size": 10000 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
filebeat/module/nginx/access/machine_learning/response_code.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"description" : "Anomaly detector for changes in event rates of nginx.access.response_code responses", | ||
"analysis_config" : { | ||
"bucket_span": "1h", | ||
"summary_count_field_name": "doc_count", | ||
"detectors": [ | ||
{ | ||
"detector_description": "Event rate for nginx.access.response_code", | ||
"function": "count", | ||
"detector_rules": [], | ||
"partition_field_name": "nginx.access.response_code" | ||
} | ||
], | ||
"influencers": ["nginx.access.response_code"] | ||
}, | ||
"data_description": { | ||
"time_field": "@timestamp", | ||
"time_format": "epoch_ms" | ||
}, | ||
"model_plot_config": { | ||
"enabled": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.