Estimate job model memory usage
- POST /_ml/anomaly_detectors/_estimate_model_memory
Make an estimation of the memory usage for an anomaly detection job model. The estimate is based on analysis configuration details for the job and cardinality estimates for the fields it references.
- Cluster privileges:
manage_ml
Request
-
analysis_configAnalysisConfig -
For a list of the properties that you can specify in the
analysis_configcomponent of the body of this API. -
bucket_spanstring Duration · default: 5m -
The size of the interval that the analysis is aggregated into, typically between
5mand1h. This value should be either a whole number of days or equate to a whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation. -
categorization_analyzerCategorizationAnalyzer -
If
categorization_field_nameis specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time ascategorization_filters. The categorization analyzer specifies how thecategorization_fieldis interpreted by the categorization process. Thecategorization_analyzerfield can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. -
categorization_field_namestring Field -
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, orpartition_field_nameto the keywordmlcategory. -
categorization_filtersstring -
If
categorization_field_nameis specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences 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. This property cannot be used at the same time ascategorization_analyzer. 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 thecategorization_analyzerproperty instead and include the filters as pattern_replace character filters. The effect is exactly the same. -
detectorsDetectorrequired -
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. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned.
-
by_field_namestring Field -
The field used to split the data. 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.
-
custom_rulesDetectionRule -
Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules.
-
actionsRuleAction · default: [ "skip_result" ] -
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.
Supported values include:
skip_result: The result will not be created. Unless you also specifyskip_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 specifyskip_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.
-
Values:
skip_resultskip_model_update -
conditionsRuleCondition -
An array of numeric conditions when the rule applies. A rule must either have a non-empty scope or at least one condition. Multiple conditions are combined together with a logical AND.
-
applies_toAppliesTorequired -
Specifies the result property to which the condition applies. If your detector uses
lat_long,metric,rare, orfreq_rarefunctions, you can only specify conditions that apply to time. -
Values:
actualtypicaldiff_from_typicaltime -
operatorConditionOperatorrequired -
Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals.
-
Values:
gtgteltlte -
valuenumberrequired -
The value that is compared against the
applies_tofield using the operator. -
scopemap string to FilterRef -
A scope of series where the rule applies. A rule must either have a non-empty scope or at least one condition. 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, orpartition_field_name. -
<string>FilterRef -
filter_idstring Idrequired -
The identifier for the filter.
-
filter_typeFilterType · default: include -
If set to
include, the rule applies for values in the filter. If set toexclude, the rule applies for values not in the filter. -
Values:
includeexclude -
detector_descriptionstring -
A description of the detector.
-
detector_indexnumber -
A unique identifier for the detector. This identifier is based on the order of the detectors in the
analysis_config, starting at zero. If you specify a value for this property, it is ignored. -
exclude_frequentExcludeFrequent -
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, you can set
exclude_frequenttoallfor both fields, or tobyoroverfor those specific fields. -
Values:
allnonebyover -
field_namestring Field -
The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The
field_namecannot contain double quotes or backslashes. -
functionstring -
The analysis function that is used. For example,
count,rare,mean,min,max, orsum. -
over_field_namestring Field -
The field used to split the data. 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.
-
partition_field_namestring Field -
The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.
-
use_nullboolean · default: false -
Defines whether a new series is used as the null series when there is no value for the by or partition fields.
-
influencersstring Field -
A comma separated list of influencer field names. 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.
-
latencystring Duration · default: 0 -
The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API.
-
model_prune_windowstring Duration -
Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the
bucket_span. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of30dor 20 timesbucket_span. -
multivariate_by_fieldsboolean -
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, 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. To use themultivariate_by_fieldsproperty, you must also specifyby_field_namein your detector. -
per_partition_categorizationPerPartitionCategorization -
Settings related to how categorization interacts with partition fields.
-
enabledboolean -
To enable this setting, you must also set the
partition_field_nameproperty to the same value in every detector that uses the keywordmlcategory. Otherwise, job creation fails. -
stop_on_warnboolean -
This setting can be set to true only if per-partition categorization is enabled. If true, both categorization and subsequent anomaly detection stops for partitions where the categorization status changes to warn. This setting makes it viable to have a job where it is expected that categorization works well for some partitions but not others; you do not pay the cost of bad categorization forever in the partitions where it works badly.
-
summary_count_field_namestring Field -
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
summary_count_field_nameapplies to all detectors in the job. NOTE: Thesummary_count_field_nameproperty cannot be used with themetricfunction. -
max_bucket_cardinalitymap string to number -
Estimates of the highest cardinality in a single bucket that is observed for influencer fields over the time period that the job analyzes data. To produce a good answer, values must be provided for all influencer fields. Providing values for fields that are not listed as
influencershas no effect on the estimation. -
overall_cardinalitymap string to number -
Estimates of the cardinality that is observed for fields over the whole time period that the job analyzes data. To produce a good answer, values must be provided for fields referenced in the
by_field_name,over_field_nameandpartition_field_nameof any detectors. Providing values for other fields has no effect on the estimation. It can be omitted from the request if no detectors have aby_field_name,over_field_nameorpartition_field_name.
Response
-
model_memory_estimatestringrequired