Get anomaly detection jobs configuration info
Added in 5.5.0
You can get information for multiple anomaly detection jobs in a single API
request by using a group name, a comma-separated list of jobs, or a wildcard
expression. You can get information for all anomaly detection jobs by using
_all
, by specifying *
as the <job_id>
, or by omitting the <job_id>
.
Path parameters
-
job_id
string | array[string] Required Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. If you do not specify one of these options, the API returns information for all anomaly detection jobs.
Query parameters
-
allow_no_match
boolean Specifies what to do when the request:
- Contains wildcard expressions and there are no jobs that match.
- Contains the _all string or no identifiers and there are no matches.
- Contains wildcard expressions and there are only partial matches.
The default value is
true
, which returns an emptyjobs
array when there are no matches and the subset of results when there are partial matches. If this parameter isfalse
, the request returns a404
status code when there are no matches or only partial matches. -
exclude_generated
boolean Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.
Responses
-
200 application/json
Hide response attributes Show response attributes object
-
count
number Required -
jobs
array[object] Required Hide jobs attributes Show jobs attributes object
-
allow_lazy_open
boolean Required Advanced configuration option. Specifies whether this job can open when there is insufficient machine learning node capacity for it to be immediately assigned to a node.
-
analysis_config
object Required Hide analysis_config attributes Show analysis_config attributes object
-
bucket_span
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. categorization_analyzer
string | object One of: Hide attributes Show attributes
-
char_filter
array One or more character filters. In addition to the built-in character filters, other plugins can provide more character filters. If this property 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 pattern replace character filters. -
filter
array One or more token filters. In addition to the built-in token filters, other plugins can provide more token filters. If this property is not specified, no token filters are applied prior to categorization.
-
-
categorization_field_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
categorization_filters
array[string] 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 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_analyzer
property instead and include the filters as pattern_replace character filters. The effect is exactly the same. -
detectors
array[object] Required 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.
Hide detectors attributes Show detectors attributes object
-
by_field_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
custom_rules
array[object] 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.
-
detector_description
string A description of the detector.
-
detector_index
number 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_frequent
string Values are
all
,none
,by
, orover
. -
field_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
function
string The analysis function that is used. For example,
count
,rare
,mean
,min
,max
, orsum
. -
over_field_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
partition_field_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
use_null
boolean Defines whether a new series is used as the null series when there is no value for the by or partition fields.
-
-
influencers
array[string] 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.
-
latency
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
model_prune_window
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
multivariate_by_fields
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, 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_fields
property, you must also specifyby_field_name
in your detector. -
per_partition_categorization
object Hide per_partition_categorization attributes Show per_partition_categorization attributes object
-
enabled
boolean To enable this setting, you must also set the
partition_field_name
property to the same value in every detector that uses the keywordmlcategory
. Otherwise, job creation fails. -
stop_on_warn
boolean 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_name
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
-
analysis_limits
object Hide analysis_limits attributes Show analysis_limits attributes object
-
The maximum number of examples stored per category in memory and in the results data store. If you increase this value, more examples are available, however it requires that you have more storage available. If you set this value to 0, no examples are stored. NOTE: The
categorization_examples_limit
applies only to analysis that uses categorization. model_memory_limit
number | string
-
-
background_persist_interval
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
blocked
object Hide blocked attributes Show blocked attributes object
create_time
string | number A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.
One of: Time unit for milliseconds
-
custom_settings
object Custom metadata about the job
-
Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies a period of time (in days) after which only the first snapshot per day is retained. This period is relative to the timestamp of the most recent snapshot for this job. Valid values range from 0 to
model_snapshot_retention_days
. -
data_description
object Required Hide data_description attributes Show data_description attributes object
-
format
string Only JSON format is supported at this time.
-
time_field
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
time_format
string The time format, which can be
epoch
,epoch_ms
, or a custom pattern. The valueepoch
refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). The valueepoch_ms
indicates that time is measured in milliseconds since the epoch. Theepoch
andepoch_ms
time formats accept either integer or real values. 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. -
field_delimiter
string
-
-
datafeed_config
object Hide datafeed_config attributes Show datafeed_config attributes object
-
aggregations
object -
authorization
object Hide authorization attributes Show authorization attributes object
-
api_key
object -
roles
array[string] If a user ID was used for the most recent update to the datafeed, its roles at the time of the update are listed in the response.
-
service_account
string If a service account was used for the most recent update to the datafeed, the account name is listed in the response.
-
-
chunking_config
object Hide chunking_config attributes Show chunking_config attributes object
-
datafeed_id
string Required -
frequency
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
indices
array[string] Required -
indexes
array[string] -
job_id
string Required -
max_empty_searches
number -
query_delay
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
script_fields
object Hide script_fields attribute Show script_fields attribute object
-
*
object Additional properties Hide * attributes Show * attributes object
-
script
object Required -
ignore_failure
boolean
-
-
-
scroll_size
number -
delayed_data_check_config
object Required Hide delayed_data_check_config attributes Show delayed_data_check_config attributes object
-
check_window
string A duration. Units can be
nanos
,micros
,ms
(milliseconds),s
(seconds),m
(minutes),h
(hours) andd
(days). Also accepts "0" without a unit and "-1" to indicate an unspecified value. -
enabled
boolean Required Specifies whether the datafeed periodically checks for delayed data.
-
-
runtime_mappings
object Hide runtime_mappings attribute Show runtime_mappings attribute object
-
*
object Additional properties Hide * attributes Show * attributes object
-
fields
object For type
composite
-
fetch_fields
array[object] For type
lookup
-
format
string A custom format for
date
type runtime fields. -
input_field
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
target_field
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
target_index
string -
script
object -
type
string Required Values are
boolean
,composite
,date
,double
,geo_point
,geo_shape
,ip
,keyword
,long
, orlookup
.
-
-
-
indices_options
object Hide indices_options attributes Show indices_options attributes object
-
allow_no_indices
boolean If false, the request returns an error if any wildcard expression, index alias, or
_all
value targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targetingfoo*,bar*
returns an error if an index starts withfoo
but no index starts withbar
. -
expand_wildcards
string | array[string] -
ignore_unavailable
boolean If true, missing or closed indices are not included in the response.
-
ignore_throttled
boolean If true, concrete, expanded or aliased indices are ignored when frozen.
-
-
query
object Required The Elasticsearch query domain-specific language (DSL). This value corresponds to the query object in an Elasticsearch search POST body. All the options that are supported by Elasticsearch can be used, as this object is passed verbatim to Elasticsearch. By default, this property has the following value:
{"match_all": {"boost": 1}}
.
-
-
deleting
boolean Indicates that the process of deleting the job is in progress but not yet completed. It is only reported when
true
. -
description
string A description of the job.
finished_time
string | number A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.
One of: Time unit for milliseconds
-
groups
array[string] A list of job groups. A job can belong to no groups or many.
-
job_id
string Required -
job_type
string Reserved for future use, currently set to
anomaly_detector
. -
job_version
string -
model_plot_config
object Hide model_plot_config attributes Show model_plot_config attributes object
-
annotations_enabled
boolean If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.
-
enabled
boolean If true, enables calculation and storage of the model bounds for each entity that is being analyzed.
-
terms
string Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.
-
-
model_snapshot_id
string -
model_snapshot_retention_days
number Required Advanced configuration option, which affects the automatic removal of old model snapshots for this job. It specifies the maximum period of time (in days) that snapshots are retained. This period is relative to the timestamp of the most recent snapshot for this job. By default, snapshots ten days older than the newest snapshot are deleted.
-
renormalization_window_days
number 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
. -
results_index_name
string Required -
results_retention_days
number Advanced configuration option. The period of time (in days) that results are retained. Age is calculated relative to the timestamp of the latest bucket result. If this property has a non-null value, once per day at 00:30 (server time), results that are the specified number of days older than the latest bucket result are deleted from Elasticsearch. The default value is null, which means all results are retained. Annotations generated by the system also count as results for retention purposes; they are deleted after the same number of days as results. Annotations added by users are retained forever.
-
-
curl \
--request GET http://api.example.com/_ml/anomaly_detectors/{job_id} \
--header "Authorization: $API_KEY"