-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs UI] Create ML module for log analysis (#42872)
* Add ml module with hard-coded timestamp field * Fix data_recognizer test * Parameterize the bucket span normalization * Remove max agg which will be specified during setup The overrides are recursively merged and therefore additive. Therefore we can't specify the timestamp agg here, because it could not be overridden later with a different field and agg name. It needs to be solely specified at setup time.
- Loading branch information
1 parent
fd80112
commit 054d4e5
Showing
5 changed files
with
82 additions
and
0 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
3 changes: 3 additions & 0 deletions
3
x-pack/legacy/plugins/ml/server/models/data_recognizer/modules/logs_ui_analysis/logo.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,3 @@ | ||
{ | ||
"icon": "loggingApp" | ||
} |
20 changes: 20 additions & 0 deletions
20
...ck/legacy/plugins/ml/server/models/data_recognizer/modules/logs_ui_analysis/manifest.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,20 @@ | ||
{ | ||
"id": "logs_ui_analysis", | ||
"title": "Log Analysis", | ||
"description": "Detect anomalies in log entries via the Logs UI", | ||
"type": "Logs", | ||
"logoFile": "logo.json", | ||
"jobs": [ | ||
{ | ||
"id": "log-entry-rate", | ||
"file": "log_entry_rate.json" | ||
} | ||
], | ||
"datafeeds": [ | ||
{ | ||
"id": "datafeed-log-entry-rate", | ||
"file": "datafeed_log_entry_rate.json", | ||
"job_id": "log-entry-rate" | ||
} | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
...ml/server/models/data_recognizer/modules/logs_ui_analysis/ml/datafeed_log_entry_rate.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,28 @@ | ||
{ | ||
"job_id": "JOB_ID", | ||
"indexes": ["INDEX_PATTERN_NAME"], | ||
"aggregations": { | ||
"buckets": { | ||
"date_histogram": { | ||
"field": "@timestamp", | ||
"fixed_interval": "900000ms" | ||
}, | ||
"aggregations": { | ||
"doc_count_per_minute": { | ||
"bucket_script": { | ||
"buckets_path": { | ||
"doc_count": "_count" | ||
}, | ||
"script": { | ||
"lang": "painless", | ||
"params": { | ||
"bucket_span_in_ms": 900000 | ||
}, | ||
"source": "60 * 1000 * params.doc_count / params.bucket_span_in_ms" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
.../plugins/ml/server/models/data_recognizer/modules/logs_ui_analysis/ml/log_entry_rate.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,30 @@ | ||
{ | ||
"job_type": "anomaly_detector", | ||
"description": "Detect anomalies in the log entry ingestion rate", | ||
"groups": ["logs-ui"], | ||
"analysis_config": { | ||
"bucket_span": "15m", | ||
"summary_count_field_name": "doc_count_per_minute", | ||
"detectors": [ | ||
{ | ||
"detector_description": "count", | ||
"function": "count", | ||
"detector_index": 0 | ||
} | ||
], | ||
"influencers": [] | ||
}, | ||
"analysis_limits": { | ||
"model_memory_limit": "10mb" | ||
}, | ||
"data_description": { | ||
"time_field": "@timestamp", | ||
"time_format": "epoch_ms" | ||
}, | ||
"model_plot_config": { | ||
"enabled": true | ||
}, | ||
"custom_settings": { | ||
"created_by": "ml-module-logs-ui-analysis" | ||
} | ||
} |