2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-job-resource]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Job resources
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
A job resource has the following properties:
|
|
|
|
|
|
|
|
`analysis_config`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(object) The analysis configuration, which specifies how to analyze the data.
|
2017-04-19 13:52:30 -04:00
|
|
|
See <<ml-analysisconfig, analysis configuration objects>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`analysis_limits`::
|
2017-04-19 13:52:30 -04:00
|
|
|
(object) Defines approximate limits on the memory resource requirements for the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
See <<ml-apilimits,analysis limits>>.
|
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
`background_persist_interval`::
|
2017-04-24 13:46:17 -04:00
|
|
|
(time units) Advanced configuration option.
|
|
|
|
The time between each periodic persistence of the model.
|
|
|
|
The default value is a randomized value between 3 to 4 hours, which avoids
|
|
|
|
all jobs persisting at exactly the same time. The smallest allowed value is
|
2017-08-02 11:25:46 -04:00
|
|
|
1 hour.
|
|
|
|
+
|
|
|
|
--
|
2017-04-24 13:46:17 -04:00
|
|
|
TIP: For very large models (several GB), persistence could take 10-20 minutes,
|
|
|
|
so do not set the `background_persist_interval` value too low.
|
2017-04-24 12:31:31 -04:00
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`create_time`::
|
2018-02-19 14:48:09 -05:00
|
|
|
(string) The time the job was created. For example, `1491007356077`. This
|
|
|
|
property is informational; you cannot change its value.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-18 16:00:15 -04:00
|
|
|
`custom_settings`::
|
|
|
|
(object) Advanced configuration option. Contains custom meta data about the
|
|
|
|
job. For example, it can contain custom URL information as shown in
|
|
|
|
{xpack-ref}/ml-configuring-url.html[Adding Custom URLs to Machine Learning Results].
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`data_description`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(object) Describes the data format and how APIs parse timestamp fields.
|
|
|
|
See <<ml-datadescription,data description objects>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`description`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) An optional description of the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`finished_time`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(string) If the job closed or failed, this is the time the job finished,
|
2018-02-19 14:48:09 -05:00
|
|
|
otherwise it is `null`. This property is informational; you cannot change its
|
|
|
|
value.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-17 15:52:29 -04:00
|
|
|
`groups`::
|
|
|
|
(array of strings) A list of job groups. A job can belong to no groups or
|
|
|
|
many. For example, `["group1", "group2"]`.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`job_id`::
|
2018-01-25 12:23:56 -05:00
|
|
|
(string) The unique identifier for the job. This identifier can contain
|
|
|
|
lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It
|
2018-02-19 14:48:09 -05:00
|
|
|
must start and end with alphanumeric characters. This property is
|
|
|
|
informational; you cannot change the identifier for existing jobs.
|
2017-04-24 13:46:17 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
`job_type`::
|
2017-04-19 13:52:30 -04:00
|
|
|
(string) Reserved for future use, currently set to `anomaly_detector`.
|
2017-04-11 21:52:47 -04:00
|
|
|
|
2018-02-09 12:16:24 -05:00
|
|
|
`job_version`::
|
|
|
|
(string) The version of {es} that existed on the node when the job was created.
|
|
|
|
|
2017-04-19 13:52:30 -04:00
|
|
|
`model_plot_config`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(object) Configuration properties for storing additional model information.
|
2017-04-19 13:52:30 -04:00
|
|
|
See <<ml-apimodelplotconfig, model plot configuration>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`model_snapshot_id`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) A numerical character string that uniquely identifies the model
|
2018-02-19 14:48:09 -05:00
|
|
|
snapshot. For example, `1491007364`. This property is informational; you
|
|
|
|
cannot change its value. For more information about model snapshots, see
|
|
|
|
<<ml-snapshot-resource>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`model_snapshot_retention_days`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(long) The time in days that model snapshots are retained for the job.
|
2018-02-21 11:58:17 -05:00
|
|
|
Older snapshots are deleted. The default value is `1`, which means snapshots
|
|
|
|
are retained for one day (twenty-four hours).
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
`renormalization_window_days`::
|
|
|
|
(long) Advanced configuration option.
|
|
|
|
The period over which adjustments to the score are applied, as new data is seen.
|
|
|
|
The default value is the longer of 30 days or 100 `bucket_spans`.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`results_index_name`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(string) The name of the index in which to store the {ml} results.
|
|
|
|
The default value is `shared`,
|
|
|
|
which corresponds to the index name `.ml-anomalies-shared`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-24 12:31:31 -04:00
|
|
|
`results_retention_days`::
|
2017-04-24 13:46:17 -04:00
|
|
|
(long) Advanced configuration option.
|
|
|
|
The number of days for which job results are retained.
|
|
|
|
Once per day at 00:30 (server time), results older than this period are
|
|
|
|
deleted from Elasticsearch. The default value is null, which means results
|
|
|
|
are retained.
|
2017-04-24 12:31:31 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-analysisconfig]]
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Analysis Configuration Objects
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
An analysis configuration object has the following properties:
|
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
`bucket_span`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(time units) The size of the interval that the analysis is aggregated into,
|
2018-07-24 20:06:46 -04:00
|
|
|
typically between `5m` and `1h`. The default value is `5m`. For more
|
|
|
|
information about time units, see <<time-units,Common options>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`categorization_field_name`::
|
2017-07-27 11:02:46 -04:00
|
|
|
(string) If this property is specified, the values of the specified field will
|
|
|
|
be categorized. The resulting categories must be used in a detector by setting
|
|
|
|
`by_field_name`, `over_field_name`, or `partition_field_name` to the keyword
|
|
|
|
`mlcategory`. For more information, see
|
2017-06-19 21:23:58 -04:00
|
|
|
{xpack-ref}/ml-configuring-categories.html[Categorizing Log Messages].
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`categorization_filters`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(array of strings) If `categorization_field_name` is specified,
|
|
|
|
you can also define optional filters. This property expects an array of
|
|
|
|
regular expressions. The expressions are used to filter out matching sequences
|
2018-01-17 16:11:36 -05:00
|
|
|
from the categorization field values. You can use this functionality to fine
|
|
|
|
tune the categorization by excluding sequences from consideration when
|
|
|
|
categories are defined. For example, you can exclude SQL statements that
|
|
|
|
appear in your log files. For more information, see
|
2017-06-19 21:23:58 -04:00
|
|
|
{xpack-ref}/ml-configuring-categories.html[Categorizing Log Messages].
|
2018-01-15 10:47:19 -05:00
|
|
|
This property cannot be used at the same time as `categorization_analyzer`.
|
2018-01-17 16:11:36 -05:00
|
|
|
If you only want to define simple regular expression filters that are applied
|
|
|
|
prior to tokenization, setting this property is the easiest method.
|
|
|
|
If you also want to customize the tokenizer or post-tokenization filtering,
|
|
|
|
use the `categorization_analyzer` property instead and include the filters as
|
|
|
|
`pattern_replace` character filters. The effect is exactly the same.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
|
|
|
`categorization_analyzer`::
|
2018-01-17 16:11:36 -05:00
|
|
|
(object or string) If `categorization_field_name` is specified, you can also
|
|
|
|
define the analyzer that is used to interpret the categorization field. This
|
|
|
|
property cannot be used at the same time as `categorization_filters`. See
|
|
|
|
<<ml-categorizationanalyzer,categorization analyzer>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
`detectors`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(array) An array of detector configuration objects,
|
2017-04-04 18:26:39 -04:00
|
|
|
which describe the anomaly detectors that are used in the job.
|
2017-04-18 18:13:21 -04:00
|
|
|
See <<ml-detectorconfig,detector configuration objects>>. +
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-24 13:46:17 -04:00
|
|
|
NOTE: If the `detectors` array does not contain at least one detector,
|
|
|
|
no analysis can occur and an error is returned.
|
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`influencers`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(array of strings) A comma separated list of influencer field names.
|
2017-04-19 16:31:07 -04:00
|
|
|
Typically these can be the by, over, or partition fields that are used in the
|
|
|
|
detector configuration. You might also want to use a field name that is not
|
|
|
|
specifically named in a detector, but is available as part of the input data.
|
|
|
|
When you use multiple detectors, the use of influencers is recommended as it
|
|
|
|
aggregates results for each influencer entity.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`latency`::
|
2017-07-27 11:25:14 -04:00
|
|
|
(time units) The size of the window in which to expect data that is out of
|
|
|
|
time order. The default value is 0 (no latency). If you specify a non-zero
|
|
|
|
value, it must be greater than or equal to one second. For more information
|
2018-07-24 20:06:46 -04:00
|
|
|
about time units, see <<time-units,Common options>>.
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-19 16:31:07 -04:00
|
|
|
NOTE: Latency is only applicable when you send data by using
|
|
|
|
the <<ml-post-data,post data>> API.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`multivariate_by_fields`::
|
2017-08-02 11:25:46 -04:00
|
|
|
(boolean) This functionality is reserved for internal use. It is not supported
|
|
|
|
for use in customer environments and is not subject to the support SLA of
|
|
|
|
official GA features.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
If set to `true`, the analysis will automatically find correlations
|
|
|
|
between metrics for a given `by` field value and report anomalies when those
|
|
|
|
correlations cease to hold. For example, suppose CPU and memory usage on host A
|
|
|
|
is usually highly correlated with the same metrics on host B. Perhaps this
|
|
|
|
correlation occurs because they are running a load-balanced application.
|
|
|
|
If you enable this property, then anomalies will be reported when, for example,
|
|
|
|
CPU usage on host A is high and the value of CPU usage on host B is low.
|
|
|
|
That is to say, you'll see an anomaly when the CPU of host A is unusual given
|
|
|
|
the CPU of host B.
|
2017-04-24 13:46:17 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
NOTE: To use the `multivariate_by_fields` property, you must also specify
|
|
|
|
`by_field_name` in your detector.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`summary_count_field_name`::
|
2017-07-27 11:02:46 -04:00
|
|
|
(string) If this property is specified, the data that is fed to the job is
|
|
|
|
expected to be pre-summarized. This property value is the name of the field
|
|
|
|
that contains the count of raw data points that have been summarized. The same
|
2017-08-02 11:25:46 -04:00
|
|
|
`summary_count_field_name` applies to all detectors in the job.
|
|
|
|
+
|
|
|
|
--
|
2017-04-19 16:31:07 -04:00
|
|
|
|
2017-04-24 13:46:17 -04:00
|
|
|
NOTE: The `summary_count_field_name` property cannot be used with the `metric`
|
|
|
|
function.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2018-02-19 14:48:09 -05:00
|
|
|
After you create a job, you cannot change the analysis configuration object; all
|
|
|
|
the properties are informational.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
[float]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-detectorconfig]]
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Detector Configuration Objects
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
Detector configuration objects specify which data fields a job analyzes.
|
|
|
|
They also specify which analytical functions are used.
|
|
|
|
You can specify multiple detectors for a job.
|
|
|
|
Each detector has the following properties:
|
|
|
|
|
|
|
|
`by_field_name`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The field used to split the data.
|
2017-04-04 18:26:39 -04:00
|
|
|
In particular, this property is used for analyzing the splits with respect to their own history.
|
|
|
|
It is used for finding unusual values in the context of the split.
|
|
|
|
|
|
|
|
`detector_description`::
|
2017-04-19 13:52:30 -04:00
|
|
|
(string) A description of the detector. For example, `Low event rate`.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-02-09 12:16:24 -05:00
|
|
|
`detector_index`::
|
|
|
|
(integer) A unique identifier for the detector. This identifier is based on
|
|
|
|
the order of the detectors in the `analysis_config`, starting at zero. You can
|
|
|
|
use this identifier when you want to update a specific detector.
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`exclude_frequent`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Contains one of the following values: `all`, `none`, `by`, or `over`.
|
2017-04-04 18:26:39 -04:00
|
|
|
If set, frequent entities are excluded from influencing the anomaly results.
|
|
|
|
Entities can be considered frequent over time or frequent in a population.
|
|
|
|
If you are working with both over and by fields, then you can set `exclude_frequent`
|
|
|
|
to `all` for both fields, or to `by` or `over` for those specific fields.
|
|
|
|
|
|
|
|
`field_name`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The field that the detector uses in the function. If you use an event rate
|
2017-04-18 18:13:21 -04:00
|
|
|
function such as `count` or `rare`, do not specify this field. +
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-24 13:46:17 -04:00
|
|
|
NOTE: The `field_name` cannot contain double quotes or backslashes.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
`function`::
|
2018-07-25 11:10:32 -04:00
|
|
|
(string) The analysis function that is used.
|
2017-05-05 13:40:17 -04:00
|
|
|
For example, `count`, `rare`, `mean`, `min`, `max`, and `sum`. For more
|
2017-06-19 21:23:58 -04:00
|
|
|
information, see {xpack-ref}/ml-functions.html[Function Reference].
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`over_field_name`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The field used to split the data.
|
2017-06-23 14:10:46 -04:00
|
|
|
In particular, this property is used for analyzing the splits with respect to
|
|
|
|
the history of all splits. It is used for finding unusual values in the
|
|
|
|
population of all splits. For more information, see
|
|
|
|
{xpack-ref}/ml-configuring-pop.html[Performing Population Analysis].
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`partition_field_name`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The field used to segment the analysis.
|
2017-04-04 18:26:39 -04:00
|
|
|
When you use this property, you have completely independent baselines for each value of this field.
|
|
|
|
|
|
|
|
`use_null`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(boolean) Defines whether a new series is used as the null series
|
2018-07-25 11:10:32 -04:00
|
|
|
when there is no value for the by or partition fields. The default value is `false`.
|
|
|
|
|
|
|
|
`custom_rules`::
|
2018-08-13 09:51:13 -04:00
|
|
|
(array) An array of custom rule objects, which enable customizing how the detector works.
|
2018-07-25 11:10:32 -04:00
|
|
|
For example, a rule may dictate to the detector conditions under which results should be skipped.
|
|
|
|
For more information see <<ml-detector-custom-rule,detector custom rule objects>>. +
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-19 16:31:07 -04:00
|
|
|
IMPORTANT: Field names are case sensitive, for example a field named 'Bytes'
|
|
|
|
is different from one named 'bytes'.
|
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
|
|
|
|
2018-07-25 11:10:32 -04:00
|
|
|
After you create a job, the only properties you can change in the detector
|
|
|
|
configuration object are the `detector_description` and the `custom_rules`;
|
|
|
|
all other properties are informational.
|
2017-04-19 16:31:07 -04:00
|
|
|
|
|
|
|
[float]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-datadescription]]
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Data Description Objects
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
The data description defines the format of the input data when you send data to
|
|
|
|
the job by using the <<ml-post-data,post data>> API. Note that when configure
|
2017-05-02 15:45:42 -04:00
|
|
|
a {dfeed}, these properties are automatically set.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
When data is received via the <<ml-post-data,post data>> API, it is not stored
|
2017-05-02 15:45:42 -04:00
|
|
|
in {es}. Only the results for anomaly detection are retained.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
A data description object has the following properties:
|
|
|
|
|
|
|
|
`format`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(string) Only `JSON` format is supported at this time.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`time_field`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The name of the field that contains the timestamp.
|
2017-04-04 18:26:39 -04:00
|
|
|
The default value is `time`.
|
|
|
|
|
|
|
|
`time_format`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) The time format, which can be `epoch`, `epoch_ms`, or a custom pattern.
|
2017-04-04 18:26:39 -04:00
|
|
|
The default value is `epoch`, which refers to UNIX or Epoch time (the number of seconds
|
2017-04-19 13:52:30 -04:00
|
|
|
since 1 Jan 1970).
|
2017-04-04 18:26:39 -04:00
|
|
|
The value `epoch_ms` indicates that time is measured in milliseconds since the epoch.
|
|
|
|
The `epoch` and `epoch_ms` time formats accept either integer or real values. +
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-19 16:31:07 -04:00
|
|
|
NOTE: Custom patterns must conform to the Java `DateTimeFormatter` class.
|
|
|
|
When you use date-time formatting patterns, it is recommended that you provide
|
|
|
|
the full date, time and time zone. For example: `yyyy-MM-dd'T'HH:mm:ssX`.
|
|
|
|
If the pattern that you specify is not sufficient to produce a complete timestamp,
|
|
|
|
job creation fails.
|
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-01-15 10:47:19 -05:00
|
|
|
[float]
|
|
|
|
[[ml-categorizationanalyzer]]
|
|
|
|
==== Categorization Analyzer
|
|
|
|
|
2018-01-15 11:29:08 -05:00
|
|
|
The categorization analyzer specifies how the `categorization_field` is
|
2018-01-15 10:47:19 -05:00
|
|
|
interpreted by the categorization process. The syntax is very similar to that
|
2018-01-15 11:29:08 -05:00
|
|
|
used to define the `analyzer` in the <<indices-analyze,Analyze endpoint>>.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
|
|
|
The `categorization_analyzer` field can be specified either as a string or as
|
|
|
|
an object.
|
|
|
|
|
2018-01-17 16:11:36 -05:00
|
|
|
If it is a string it must refer to a <<analysis-analyzers,built-in analyzer>> or
|
|
|
|
one added by another plugin.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
|
|
|
If it is an object it has the following properties:
|
|
|
|
|
|
|
|
`char_filter`::
|
|
|
|
(array of strings or objects) One or more
|
2018-01-17 16:11:36 -05:00
|
|
|
<<analysis-charfilters,character filters>>. In addition to the built-in
|
|
|
|
character filters, other plugins can provide more character filters. This
|
|
|
|
property is optional. If it is not specified, no character filters are applied
|
|
|
|
prior to categorization. If you are customizing some other aspect of the
|
|
|
|
analyzer and you need to achieve the equivalent of `categorization_filters`
|
|
|
|
(which are not permitted when some other aspect of the analyzer is customized),
|
|
|
|
add them here as
|
|
|
|
<<analysis-pattern-replace-charfilter,pattern replace character filters>>.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
|
|
|
`tokenizer`::
|
|
|
|
(string or object) The name or definition of the
|
2018-01-17 16:11:36 -05:00
|
|
|
<<analysis-tokenizers,tokenizer>> to use after character filters are applied.
|
|
|
|
This property is compulsory if `categorization_analyzer` is specified as an
|
|
|
|
object. Machine learning provides a tokenizer called `ml_classic` that
|
|
|
|
tokenizes in the same way as the non-customizable tokenizer in older versions
|
|
|
|
of the product. If you want to use that tokenizer but change the character or
|
|
|
|
token filters, specify `"tokenizer": "ml_classic"` in your
|
|
|
|
`categorization_analyzer`.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
|
|
|
`filter`::
|
|
|
|
(array of strings or objects) One or more
|
2018-01-17 16:11:36 -05:00
|
|
|
<<analysis-tokenfilters,token filters>>. In addition to the built-in token
|
|
|
|
filters, other plugins can provide more token filters. This property is
|
|
|
|
optional. If it is not specified, no token filters are applied prior to
|
|
|
|
categorization.
|
2018-01-15 10:47:19 -05:00
|
|
|
|
2018-01-17 16:11:36 -05:00
|
|
|
If you omit the `categorization_analyzer`, the following default values are used:
|
2018-01-15 10:47:19 -05:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2018-01-15 10:47:19 -05:00
|
|
|
--------------------------------------------------
|
2018-12-07 15:34:11 -05:00
|
|
|
POST _ml/anomaly_detectors/_validate
|
2018-01-15 10:47:19 -05:00
|
|
|
{
|
|
|
|
"analysis_config" : {
|
|
|
|
"categorization_analyzer" : {
|
|
|
|
"tokenizer" : "ml_classic",
|
|
|
|
"filter" : [
|
|
|
|
{ "type" : "stop", "stopwords": [
|
|
|
|
"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday",
|
|
|
|
"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun",
|
|
|
|
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December",
|
|
|
|
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
|
|
|
|
"GMT", "UTC"
|
|
|
|
] }
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"categorization_field_name": "message",
|
|
|
|
"detectors" :[{
|
|
|
|
"function":"count",
|
|
|
|
"by_field_name": "mlcategory"
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
"data_description" : {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2018-01-17 16:11:36 -05:00
|
|
|
If you specify any part of the `categorization_analyzer`, however, any omitted
|
|
|
|
sub-properties are _not_ set to default values.
|
|
|
|
|
|
|
|
If you are categorizing non-English messages in a language where words are
|
|
|
|
separated by spaces, you might get better results if you change the day or month
|
|
|
|
words in the stop token filter to the appropriate words in your language. If you
|
|
|
|
are categorizing messages in a language where words are not separated by spaces,
|
|
|
|
you must use a different tokenizer as well in order to get sensible
|
|
|
|
categorization results.
|
|
|
|
|
|
|
|
It is important to be aware that analyzing for categorization of machine
|
|
|
|
generated log messages is a little different from tokenizing for search.
|
|
|
|
Features that work well for search, such as stemming, synonym substitution, and
|
|
|
|
lowercasing are likely to make the results of categorization worse. However, in
|
|
|
|
order for drill down from {ml} results to work correctly, the tokens that the
|
|
|
|
categorization analyzer produces must be similar to those produced by the search
|
|
|
|
analyzer. If they are sufficiently similar, when you search for the tokens that
|
|
|
|
the categorization analyzer produces then you find the original document that
|
|
|
|
the categorization field value came from.
|
|
|
|
|
|
|
|
For more information, see
|
|
|
|
{xpack-ref}/ml-configuring-categories.html[Categorizing Log Messages].
|
2018-01-15 10:47:19 -05:00
|
|
|
|
2018-07-25 11:10:32 -04:00
|
|
|
[float]
|
|
|
|
[[ml-detector-custom-rule]]
|
|
|
|
==== Detector Custom Rule
|
|
|
|
|
|
|
|
{stack-ov}/ml-rules.html[Custom rules] enable you to customize the way detectors
|
|
|
|
operate.
|
|
|
|
|
2018-08-13 09:51:13 -04:00
|
|
|
A custom rule has the following properties:
|
2018-07-25 11:10:32 -04:00
|
|
|
|
|
|
|
`actions`::
|
|
|
|
(array) The set of actions to be triggered when the rule applies.
|
|
|
|
If more than one action is specified the effects of all actions are combined.
|
|
|
|
The available actions include: +
|
|
|
|
`skip_result`::: The result will not be created. This is the default value.
|
|
|
|
Unless you also specify `skip_model_update`, the model will be updated as
|
|
|
|
usual with the corresponding series value.
|
|
|
|
`skip_model_update`::: The value for that series will not be used to update
|
|
|
|
the model. Unless you also specify `skip_result`, the results will be created
|
|
|
|
as usual. This action is suitable when certain values are expected to be
|
|
|
|
consistently anomalous and they affect the model in a way that negatively
|
|
|
|
impacts the rest of the results.
|
2018-07-26 15:28:26 -04:00
|
|
|
|
2018-07-25 11:10:32 -04:00
|
|
|
`scope`::
|
2018-07-26 15:28:26 -04:00
|
|
|
(object) An optional scope of series where the rule applies. By default, the
|
|
|
|
scope includes all series. Scoping is allowed for any of the fields that are
|
|
|
|
also specified in `by_field_name`, `over_field_name`, or `partition_field_name`.
|
|
|
|
To add a scope for a field, add the field name as a key in the scope object and
|
|
|
|
set its value to an object with the following properties:
|
|
|
|
`filter_id`:::
|
2019-07-15 12:44:57 -04:00
|
|
|
(string) The id of the filter to be used.
|
2018-07-26 15:28:26 -04:00
|
|
|
|
|
|
|
`filter_type`:::
|
|
|
|
(string) Either `include` (the rule applies for values in the filter)
|
|
|
|
or `exclude` (the rule applies for values not in the filter). Defaults
|
|
|
|
to `include`.
|
2018-07-25 11:10:32 -04:00
|
|
|
|
|
|
|
`conditions`::
|
|
|
|
(array) An optional array of numeric conditions when the rule applies.
|
|
|
|
Multiple conditions are combined together with a logical `AND`.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
NOTE: If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare`
|
2018-08-01 13:15:46 -04:00
|
|
|
functions, you can only specify `conditions` that apply to `time`.
|
2018-07-25 11:10:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
A condition has the following properties:
|
|
|
|
|
|
|
|
`applies_to`:::
|
|
|
|
(string) Specifies the result property to which the condition applies.
|
|
|
|
The available options are `actual`, `typical`, `diff_from_typical`, `time`.
|
|
|
|
`operator`:::
|
|
|
|
(string) Specifies the condition operator. The available options are
|
|
|
|
`gt` (greater than), `gte` (greater than or equals), `lt` (less than) and `lte` (less than or equals).
|
|
|
|
`value`:::
|
2018-07-31 12:00:55 -04:00
|
|
|
(double) The value that is compared against the `applies_to` field using the `operator`.
|
2018-07-25 11:10:32 -04:00
|
|
|
--
|
|
|
|
|
|
|
|
A rule is required to either have a non-empty scope or at least one condition.
|
|
|
|
For more examples see
|
|
|
|
{stack-ov}/ml-configuring-detector-custom-rules.html[Configuring Detector Custom Rules].
|
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
[float]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-apilimits]]
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Analysis Limits
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-19 13:52:30 -04:00
|
|
|
Limits can be applied for the resources required to hold the mathematical models in memory.
|
2017-04-19 16:31:07 -04:00
|
|
|
These limits are approximate and can be set per job. They do not control the
|
|
|
|
memory used by other processes, for example the Elasticsearch Java processes.
|
|
|
|
If necessary, you can increase the limits after the job is created.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
The `analysis_limits` object has the following properties:
|
|
|
|
|
|
|
|
`categorization_examples_limit`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(long) The maximum number of examples stored per category in memory and
|
2017-04-04 18:26:39 -04:00
|
|
|
in the results data store. The default value is 4. If you increase this value,
|
|
|
|
more examples are available, however it requires that you have more storage available.
|
2017-04-19 16:31:07 -04:00
|
|
|
If you set this value to `0`, no examples are stored. +
|
2017-08-02 11:25:46 -04:00
|
|
|
+
|
|
|
|
--
|
2017-04-24 13:46:17 -04:00
|
|
|
NOTE: The `categorization_examples_limit` only applies to analysis that uses categorization.
|
2017-06-19 21:23:58 -04:00
|
|
|
For more information, see
|
|
|
|
{xpack-ref}/ml-configuring-categories.html[Categorizing Log Messages].
|
|
|
|
|
2017-08-02 11:25:46 -04:00
|
|
|
--
|
2017-04-19 16:31:07 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
`model_memory_limit`::
|
2017-07-10 11:50:38 -04:00
|
|
|
(long or string) The approximate maximum amount of memory resources that are
|
|
|
|
required for analytical processing. Once this limit is approached, data pruning
|
2017-05-02 18:34:30 -04:00
|
|
|
becomes more aggressive. Upon exceeding this limit, new entities are not
|
2017-08-21 11:51:30 -04:00
|
|
|
modeled. The default value for jobs created in version 6.1 and later is `1024mb`.
|
|
|
|
This value will need to be increased for jobs that are expected to analyze high
|
|
|
|
cardinality fields, but the default is set to a relatively small size to ensure
|
|
|
|
that high resource usage is a conscious decision. The default value for jobs
|
2017-10-25 12:00:53 -04:00
|
|
|
created in versions earlier than 6.1 is `4096mb`.
|
|
|
|
+
|
|
|
|
--
|
|
|
|
If you specify a number instead of a string, the units are assumed to be MiB.
|
|
|
|
Specifying a string is recommended for clarity. If you specify a byte size unit
|
|
|
|
of `b` or `kb` and the number does not equate to a discrete number of megabytes,
|
|
|
|
it is rounded down to the closest MiB. The minimum valid value is 1 MiB. If you
|
|
|
|
specify a value less than 1 MiB, an error occurs. For more information about
|
2018-07-24 20:06:46 -04:00
|
|
|
supported byte size units, see <<byte-units,Common options>>.
|
2017-10-25 12:00:53 -04:00
|
|
|
|
|
|
|
If your `elasticsearch.yml` file contains an `xpack.ml.max_model_memory_limit`
|
|
|
|
setting, an error occurs when you try to create jobs that have
|
|
|
|
`model_memory_limit` values greater than that setting. For more information,
|
|
|
|
see <<ml-settings>>.
|
|
|
|
--
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
[float]
|
2017-04-19 13:52:30 -04:00
|
|
|
[[ml-apimodelplotconfig]]
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Model Plot Config
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
This advanced configuration option stores model information along with the
|
2017-07-10 11:50:38 -04:00
|
|
|
results. It provides a more detailed view into anomaly detection.
|
2017-06-28 10:32:32 -04:00
|
|
|
|
2017-07-10 11:50:38 -04:00
|
|
|
WARNING: If you enable model plot it can add considerable overhead to the performance
|
2017-06-28 10:32:32 -04:00
|
|
|
of the system; it is not feasible for jobs with many entities.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-04-19 16:31:07 -04:00
|
|
|
Model plot provides a simplified and indicative view of the model and its bounds.
|
|
|
|
It does not display complex features such as multivariate correlations or multimodal data.
|
|
|
|
As such, anomalies may occasionally be reported which cannot be seen in the model plot.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
2017-07-10 11:50:38 -04:00
|
|
|
Model plot config can be configured when the job is created or updated later. It must be
|
2017-06-28 10:32:32 -04:00
|
|
|
disabled if performance issues are experienced.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
|
|
|
The `model_plot_config` object has the following properties:
|
|
|
|
|
|
|
|
`enabled`::
|
2017-04-19 16:31:07 -04:00
|
|
|
(boolean) If true, enables calculation and storage of the model bounds for
|
|
|
|
each entity that is being analyzed. By default, this is not enabled.
|
2017-04-19 13:52:30 -04:00
|
|
|
|
|
|
|
`terms`::
|
2018-04-12 12:59:17 -04:00
|
|
|
experimental[] (string) Limits data collection to this comma separated list of
|
|
|
|
partition or by field values. If terms are not specified or it is an empty
|
|
|
|
string, no filtering is applied. For example, "CPU,NetworkIn,DiskWrites".
|
|
|
|
Wildcards are not supported. Only the specified `terms` can be viewed when
|
|
|
|
using the Single Metric Viewer.
|