---
type: api
title: Create an anomaly detection job
description: If you include a `datafeed_config`, you must have read index privileges on the source index.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-ml-put-job
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/operation/operation-ml-put-job
products:
  - Elasticsearch
---

# Create an anomaly detection job

Availability: 5.4+

## Paths

- `PUT` `/_ml/anomaly_detectors/{job_id}`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#apikeyauth)
- [Basic auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#basicauth)
- [Bearer auth](/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/authentication#bearerauth)

#### Path Parameters

- `job_id` (string Id)
  The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.

## Description

If you include a `datafeed_config`, you must have read index privileges on the source index.
If you include a `datafeed_config` but do not provide a query, the datafeed uses `{"match_all": {"boost": 1}}`.

## Required authorization

* Index privileges: `read`
* Cluster privileges: `manage_ml`

## Query String Parameters

- `allow_no_indices` (boolean · default: true)
  A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.
- `expand_wildcards` (string ExpandWildcards · default: open)
  Type of index that wildcard patterns can match. If the request can target data streams, this argument determines
whether wildcard expressions match hidden data streams. Supports comma-separated values.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
  Values: `all`, `open`, `closed`, `hidden`, `none`
- `ignore_throttled` (boolean · default: true) — deprecated
  If `true`, concrete, expanded or aliased indices are ignored when frozen.
- `ignore_unavailable` (boolean · default: false)
  If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.

## Request Body

`application/json`

- `allow_lazy_open` (boolean · default: false) — optional
  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. By default, if a machine learning node with capacity to run the job cannot immediately be found, the open anomaly detection jobs API returns an error. However, this is also subject to the cluster-wide `xpack.ml.max_lazy_ml_nodes` setting. If this option is set to true, the open anomaly detection jobs API does not return an error and the job waits in the opening state until sufficient machine learning node capacity is available.
- `analysis_config` ({} AnalysisConfig) — required
  Specifies how to analyze the data. After you create a job, you cannot change the analysis configuration; all the properties are informational.
  - `bucket_span` (string Duration · default: 5m) — optional
    The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. 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_analyzer` (CategorizationAnalyzer) — optional
    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`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field 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_name` (string Field) — optional
    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`.
  - `categorization_filters` ([] string) — optional
    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 as `categorization_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 the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.
  - `detectors` ([] Detector) — 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.
    - `by_field_name` (string Field) — optional
      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_rules` ([] DetectionRule) — optional
      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.
      - `actions` ([] enum RuleAction · default: [
  "skip_result"
]) — optional
        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 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.
        Values: `skip_result`, `skip_model_update`
      - `conditions` ([] RuleCondition) — optional
        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_to` (enum AppliesTo) — required
          Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time.
          Values: `actual`, `typical`, `diff_from_typical`, `time`
        - `operator` (enum ConditionOperator) — required
          Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals.
          Values: `gt`, `gte`, `lt`, `lte`
        - `value` (number) — required
          The value that is compared against the `applies_to` field using the operator.
      - `scope` (map string to FilterRef) — optional
        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`, or `partition_field_name`.
        Map values ({} FilterRef)
        - `filter_id` (string Id) — required
          The identifier for the filter.
        - `filter_type` (enum FilterType · default: include) — optional
          If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter.
          Values: `include`, `exclude`
    - `detector_description` (string) — optional
      A description of the detector.
    - `detector_index` (number) — optional
      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` (enum ExcludeFrequent) — optional
      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_frequent` to `all` for both fields, or to `by` or `over` for those specific fields.
      Values: `all`, `none`, `by`, `over`
    - `field_name` (string Field) — optional
      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_name` cannot contain double quotes or backslashes.
    - `function` (string) — optional
      The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.
    - `over_field_name` (string Field) — optional
      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_name` (string Field) — optional
      The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.
    - `use_null` (boolean · default: false) — optional
      Defines whether a new series is used as the null series when there is no value for the by or partition fields.
  - `influencers` ([] string Field) — optional
    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 Duration · default: 0) — optional
    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_window` (string Duration) — optional
    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 of `30d` or 20 times `bucket_span`.
  - `multivariate_by_fields` (boolean) — optional
    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 the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.
  - `per_partition_categorization` ({} PerPartitionCategorization) — optional
    Settings related to how categorization interacts with partition fields.
    - `enabled` (boolean) — optional
      To enable this setting, you must also set the `partition_field_name` property to the same value in every detector that uses the keyword `mlcategory`. Otherwise, job creation fails.
    - `stop_on_warn` (boolean) — optional
      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 Field) — optional
    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_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function.
- `analysis_limits` ({} AnalysisLimits) — optional
  Limits can be applied for the resources required to hold the mathematical models in memory. 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.
  - `categorization_examples_limit` (number · default: 4) — optional
    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 ByteSize · default: 1024mb) — optional
    The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. 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. If you specify a value for the `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 value.
- `background_persist_interval` (string Duration) — optional
  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 1 hour. For very large models (several GB), persistence could take 10-20 minutes, so do not set the `background_persist_interval` value too low.
- `custom_settings` (CustomSettings) — optional
  Advanced configuration option. Contains custom meta data about the job.
- `daily_model_snapshot_retention_after_days` (number · default: 1) — optional
  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` ({} DataDescription) — required
  Defines the format of the input data when you send data to the job by using the post data API. Note that when configure a datafeed, these properties are automatically set. When data is received via the post data API, it is not stored in Elasticsearch. Only the results for anomaly detection are retained.
  - `format` (string) — optional
    Only JSON format is supported at this time.
  - `time_field` (string Field · default: time) — optional
    The name of the field that contains the timestamp.
  - `time_format` (string · default: epoch) — optional
    The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). 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. 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) — optional
- `datafeed_config` ({} DatafeedConfig) — optional
  Defines a datafeed for the anomaly detection job. If Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, those credentials are used instead.
  - `aggregations` (map string to {} AggregationContainer) — optional
    If set, the datafeed performs aggregation searches. Support for aggregations is limited and should be used only with low cardinality data.
    See [AggregationContainer](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/types/_types-aggregations-aggregationcontainer)
  - `chunking_config` ({} ChunkingConfig) — optional
    Datafeeds might be required to search over long time periods, for several months or years. This search is split into time chunks in order to ensure the load on Elasticsearch is managed. Chunking configuration controls how the size of these time chunks are calculated and is an advanced configuration option.
    - `mode` (enum ChunkingMode) — required
      If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
      Values: `auto`, `manual`, `off`
    - `time_span` (string Duration · default: 3h) — optional
      The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`.
  - `datafeed_id` (string Id) — optional
    A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. The default value is the job identifier.
  - `delayed_data_check_config` ({} DelayedDataCheckConfig) — optional
    Specifies whether the datafeed checks for missing data and the size of the window. The datafeed can optionally search over indices that have already been read in an effort to determine whether any data has subsequently been added to the index. If missing data is found, it is a good indication that the `query_delay` option is set too low and the data is being indexed after the datafeed has passed that moment in time. This check runs only on real-time datafeeds.
    - `check_window` (string Duration) — optional
      The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
    - `enabled` (boolean) — required
      Specifies whether the datafeed periodically checks for delayed data.
  - `frequency` (string Duration) — optional
    The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.
  - `indices` (string Indices) — optional
    An array of index names. Wildcards are supported. If any indices are in remote clusters, the machine learning nodes must have the `remote_cluster_client` role.
  - `indices_options` ({} IndicesOptions) — optional
    Specifies index expansion options that are used during search.
    - `allow_no_indices` (boolean) — optional
      A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.
    - `expand_wildcards` (string ExpandWildcards) — optional
      Type of index that wildcard patterns can match. If the request can target data streams, this argument
determines whether wildcard expressions match hidden data streams. Supports comma-separated values,
such as `open,hidden`.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
      Values: `all`, `open`, `closed`, `hidden`, `none`
    - `ignore_unavailable` (boolean · default: false) — optional
      If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.
    - `ignore_throttled` (boolean · default: true) — optional
      If true, concrete, expanded or aliased indices are ignored when frozen.
  - `job_id` (string Id) — optional
  - `max_empty_searches` (number) — optional
    If a real-time datafeed has never seen any data (including during any initial training period) then it will automatically stop itself and close its associated job after this many real-time searches that return no documents. In other words, it will stop after `frequency` times `max_empty_searches` of real-time operation. If not set then a datafeed with no end time that sees no data will remain started until it is explicitly stopped.
  - `max_consecutive_extraction_failures` (number) — optional
    The maximum number of consecutive real-time data extraction failures the datafeed tolerates before it automatically stops itself, leaving the associated job open. The consecutive-failure counter resets on any cycle that extracts successfully, including empty-data cycles. If not set, the threshold defaults to roughly one day's worth of searches based on the datafeed `frequency` (floored at 1). Set to `-1` to disable auto-stop and retry indefinitely. Values of `0` or less than `-1` are rejected.
  - `query` ({} QueryContainer) — optional
    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.
    See [QueryContainer](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/types/_types-query_dsl-querycontainer)
  - `query_delay` (string Duration) — optional
    The number of seconds behind real time that data is queried. For example, if data from 10:04 a.m. might not be searchable in Elasticsearch until 10:06 a.m., set this property to 120 seconds. The default value is randomly selected between `60s` and `120s`. This randomness improves the query performance when there are multiple jobs running on the same node.
  - `runtime_mappings` (RuntimeFields) — optional
    Specifies runtime fields for the datafeed search.
  - `script_fields` (map string to ScriptField) — optional
    Specifies scripts that evaluate custom expressions and returns script fields to the datafeed. The detector configuration objects in a job can contain functions that use these script fields.
    Map values ({} ScriptField)
    - `script` (string Script) — required
    - `ignore_failure` (boolean) — optional
  - `scroll_size` (number · default: 1000) — optional
    The size parameter that is used in Elasticsearch searches when the datafeed does not use aggregations. The maximum value is the value of `index.max_result_window`, which is 10,000 by default.
- `description` (string) — optional
  A description of the job.
- `job_id` (string Id) — optional
  The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters.
- `groups` ([] string) — optional
  A list of job groups. A job can belong to no groups or many.
- `model_plot_config` ({} ModelPlotConfig) — optional
  This advanced configuration option stores model information along with the results. It provides a more detailed view into anomaly detection. If you enable model plot it can add considerable overhead to the performance of the system; it is not feasible for jobs with many entities. 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. Model plot config can be configured when the job is created or updated later. It must be disabled if performance issues are experienced.
  - `annotations_enabled` (boolean · default: true) — optional
    If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.
  - `enabled` (boolean · default: false) — optional
    If true, enables calculation and storage of the model bounds for each entity that is being analyzed.
  - `terms` (string Field) — optional
    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. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer.
- `model_snapshot_retention_days` (number · default: 10) — optional
  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) — optional
  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 IndexName · default: shared) — optional
  A text string that affects the name of the machine learning results index. By default, the job generates an index named `.ml-anomalies-shared`.
- `results_retention_days` (number) — optional
  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.

## Response

`application/json`

- `allow_lazy_open` (boolean)
- `analysis_config` ({} AnalysisConfigRead)
  - `bucket_span` (string Duration · default: 5m)
    The size of the interval that the analysis is aggregated into, typically between `5m` and `1h`. 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.
  - `detectors` ([] DetectorRead)
    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.
    - `function` (string)
      The analysis function that is used. For example, `count`, `rare`, `mean`, `min`, `max`, or `sum`.
    - `by_field_name` (string 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_rules` ([] DetectionRule)
      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.
      - `actions` ([] enum RuleAction · 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 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.
        Values: `skip_result`, `skip_model_update`
      - `conditions` ([] RuleCondition)
        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_to` (enum AppliesTo)
          Specifies the result property to which the condition applies. If your detector uses `lat_long`, `metric`, `rare`, or `freq_rare` functions, you can only specify conditions that apply to time.
          Values: `actual`, `typical`, `diff_from_typical`, `time`
        - `operator` (enum ConditionOperator)
          Specifies the condition operator. The available options are greater than, greater than or equals, less than, and less than or equals.
          Values: `gt`, `gte`, `lt`, `lte`
        - `value` (number)
          The value that is compared against the `applies_to` field using the operator.
      - `scope` (map 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`, or `partition_field_name`.
        Map values ({} FilterRef)
        - `filter_id` (string Id)
          The identifier for the filter.
        - `filter_type` (enum FilterType · default: include)
          If set to `include`, the rule applies for values in the filter. If set to `exclude`, the rule applies for values not in the filter.
          Values: `include`, `exclude`
    - `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` (enum ExcludeFrequent)
      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_frequent` to `all` for both fields, or to `by` or `over` for those specific fields.
      Values: `all`, `none`, `by`, `over`
    - `field_name` (string 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_name` cannot contain double quotes or backslashes.
    - `over_field_name` (string 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_name` (string 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_null` (boolean · default: false)
      Defines whether a new series is used as the null series when there is no value for the by or partition fields.
  - `influencers` ([] string 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.
  - `categorization_analyzer` (CategorizationAnalyzer)
    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`. The categorization analyzer specifies how the `categorization_field` is interpreted by the categorization process. The `categorization_analyzer` field 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_name` (string 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`, or `partition_field_name` to the keyword `mlcategory`.
  - `categorization_filters` ([] 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 as `categorization_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 the `categorization_analyzer` property instead and include the filters as pattern_replace character filters. The effect is exactly the same.
  - `latency` (string 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_window` (string 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 of `30d` or 20 times `bucket_span`.
  - `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 the `multivariate_by_fields` property, you must also specify `by_field_name` in your detector.
  - `per_partition_categorization` ({} PerPartitionCategorization)
    Settings related to how categorization interacts with partition fields.
    - `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 keyword `mlcategory`. 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 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_name` applies to all detectors in the job. NOTE: The `summary_count_field_name` property cannot be used with the `metric` function.
- `analysis_limits` ({} AnalysisLimits)
  - `categorization_examples_limit` (number · default: 4)
    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 ByteSize · default: 1024mb)
    The approximate maximum amount of memory resources that are required for analytical processing. Once this limit is approached, data pruning becomes more aggressive. Upon exceeding this limit, new entities are not modeled. If the `xpack.ml.max_model_memory_limit` setting has a value greater than 0 and less than 1024mb, that value is used instead of the default. The default value is relatively small to ensure that high resource usage is a conscious decision. If you have jobs that are expected to analyze high cardinality fields, you will likely need to use a higher value. 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. If you specify a value for the `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 value.
- `background_persist_interval` (string Duration)
- `create_time` (DateTime)
- `custom_settings` (CustomSettings)
- `daily_model_snapshot_retention_after_days` (number)
- `data_description` ({} DataDescription)
  - `format` (string)
    Only JSON format is supported at this time.
  - `time_field` (string Field · default: time)
    The name of the field that contains the timestamp.
  - `time_format` (string · default: epoch)
    The time format, which can be `epoch`, `epoch_ms`, or a custom pattern. The value `epoch` refers to UNIX or Epoch time (the number of seconds since 1 Jan 1970). 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. 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` ({} Datafeed)
  - `aggregations` (map string to {} AggregationContainer)
    See [AggregationContainer](https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/elasticsearch/v9/types/_types-aggregations-aggregationcontainer)
  - `authorization` ({} DatafeedAuthorization)
    The security privileges that the datafeed uses to run its queries. If Elastic Stack security features were disabled at the time of the most recent update to the datafeed, this property is omitted.
    - `api_key` ({} ApiKeyAuthorization)
      If an API key was used for the most recent update to the datafeed, its name and identifier are listed in the response.
      - `id` (string)
        The identifier for the API key.
      - `name` (string)
        The name of the API key.
    - `roles` ([] 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` ({} ChunkingConfig)
    - `mode` (enum ChunkingMode)
      If the mode is `auto`, the chunk size is dynamically calculated;
this is the recommended value when the datafeed does not use aggregations.
If the mode is `manual`, chunking is applied according to the specified `time_span`;
use this mode when the datafeed uses aggregations. If the mode is `off`, no chunking is applied.
      Values: `auto`, `manual`, `off`
    - `time_span` (string Duration · default: 3h)
      The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`.
  - `datafeed_id` (string Id)
  - `frequency` (string Duration)
    The interval at which scheduled queries are made while the datafeed runs in real time. The default value is either the bucket span for short bucket spans, or, for longer bucket spans, a sensible fraction of the bucket span. For example: `150s`. When `frequency` is shorter than the bucket span, interim results for the last (partial) bucket are written then eventually overwritten by the full bucket results. If the datafeed uses aggregations, this value must be divisible by the interval of the date histogram aggregation.
  - `indices` ([] string)
  - `indexes` ([] string)
  - `job_id` (string Id)
  - `max_empty_searches` (number)
  - `query_delay` (string Duration)
  - `script_fields` (map string to ScriptField)
    Map values ({} ScriptField)
    - `script` (string Script)
    - `ignore_failure` (boolean)
  - `scroll_size` (number)
  - `delayed_data_check_config` ({} DelayedDataCheckConfig)
    - `check_window` (string Duration)
      The window of time that is searched for late data. This window of time ends with the latest finalized bucket.
It defaults to null, which causes an appropriate `check_window` to be calculated when the real-time datafeed runs.
In particular, the default `check_window` span calculation is based on the maximum of `2h` or `8 * bucket_span`.
    - `enabled` (boolean)
      Specifies whether the datafeed periodically checks for delayed data.
  - `runtime_mappings` (RuntimeFields)
  - `indices_options` ({} IndicesOptions)
    - `allow_no_indices` (boolean)
      A setting that does two separate checks on the index expression.
If `false`, the request returns an error (1) if any wildcard expression
(including `_all` and `*`) resolves to zero matching indices or (2) if the
complete set of resolved indices, aliases or data streams is empty after all
expressions are evaluated. If `true`, index expressions that resolve to no
indices are allowed and the request returns an empty result.
    - `expand_wildcards` (string ExpandWildcards)
      Type of index that wildcard patterns can match. If the request can target data streams, this argument
determines whether wildcard expressions match hidden data streams. Supports comma-separated values,
such as `open,hidden`.

Supported values include:
  - `all`: Match any data stream or index, including hidden ones.
  - `open`: Match open, non-hidden indices. Also matches any non-hidden data stream.
  - `closed`: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed.
  - `hidden`: Match hidden data streams and hidden indices. Must be combined with `open`, `closed`, or `both`.
  - `none`: Wildcard expressions are not accepted.
      Values: `all`, `open`, `closed`, `hidden`, `none`
    - `ignore_unavailable` (boolean · default: false)
      If `false`, the request returns an error if it targets a concrete (non-wildcarded)
index, alias, or data stream that is missing, closed, or otherwise unavailable.
If `true`, unavailable concrete targets are silently ignored.
    - `ignore_throttled` (boolean · default: true)
      If true, concrete, expanded or aliased indices are ignored when frozen.
  - `query` (object)
    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}}`.
- `description` (string)
- `groups` ([] string)
- `job_id` (string Id)
- `job_type` (string)
- `job_version` (string)
- `model_plot_config` ({} ModelPlotConfig)
  - `annotations_enabled` (boolean · default: true)
    If true, enables calculation and storage of the model change annotations for each entity that is being analyzed.
  - `enabled` (boolean · default: false)
    If true, enables calculation and storage of the model bounds for each entity that is being analyzed.
  - `terms` (string Field)
    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. Wildcards are not supported. Only the specified terms can be viewed when using the Single Metric Viewer.
- `model_snapshot_id` (string Id)
- `model_snapshot_retention_days` (number)
- `renormalization_window_days` (number)
- `results_index_name` (string)
- `results_retention_days` (number)
## Code Examples

#### Console

```console
PUT /_ml/anomaly_detectors/job-01
{
  "analysis_config": {
    "bucket_span": "15m",
    "detectors": [
      {
        "detector_description": "Sum of bytes",
        "function": "sum",
        "field_name": "bytes"
      }
    ]
  },
  "data_description": {
    "time_field": "timestamp",
    "time_format": "epoch_ms"
  },
  "analysis_limits": {
    "model_memory_limit": "11MB"
  },
  "model_plot_config": {
    "enabled": true,
    "annotations_enabled": true
  },
  "results_index_name": "test-job1",
  "datafeed_config": {
    "indices": [
      "kibana_sample_data_logs"
    ],
    "query": {
      "bool": {
        "must": [
          {
            "match_all": {}
          }
        ]
      }
    },
    "runtime_mappings": {
      "hour_of_day": {
        "type": "long",
        "script": {
          "source": "emit(doc['timestamp'].value.getHour());"
        }
      }
    },
    "datafeed_id": "datafeed-test-job1"
  }
}
```

#### JavaScript

```javascript
const response = await client.ml.putJob({
  job_id: "job-01",
  analysis_config: {
    bucket_span: "15m",
    detectors: [
      {
        detector_description: "Sum of bytes",
        function: "sum",
        field_name: "bytes",
      },
    ],
  },
  data_description: {
    time_field: "timestamp",
    time_format: "epoch_ms",
  },
  analysis_limits: {
    model_memory_limit: "11MB",
  },
  model_plot_config: {
    enabled: true,
    annotations_enabled: true,
  },
  results_index_name: "test-job1",
  datafeed_config: {
    indices: ["kibana_sample_data_logs"],
    query: {
      bool: {
        must: [
          {
            match_all: {},
          },
        ],
      },
    },
    runtime_mappings: {
      hour_of_day: {
        type: "long",
        script: {
          source: "emit(doc['timestamp'].value.getHour());",
        },
      },
    },
    datafeed_id: "datafeed-test-job1",
  },
});
```

#### Python

```python
resp = client.ml.put_job(
    job_id="job-01",
    analysis_config={
        "bucket_span": "15m",
        "detectors": [
            {
                "detector_description": "Sum of bytes",
                "function": "sum",
                "field_name": "bytes"
            }
        ]
    },
    data_description={
        "time_field": "timestamp",
        "time_format": "epoch_ms"
    },
    analysis_limits={
        "model_memory_limit": "11MB"
    },
    model_plot_config={
        "enabled": True,
        "annotations_enabled": True
    },
    results_index_name="test-job1",
    datafeed_config={
        "indices": [
            "kibana_sample_data_logs"
        ],
        "query": {
            "bool": {
                "must": [
                    {
                        "match_all": {}
                    }
                ]
            }
        },
        "runtime_mappings": {
            "hour_of_day": {
                "type": "long",
                "script": {
                    "source": "emit(doc['timestamp'].value.getHour());"
                }
            }
        },
        "datafeed_id": "datafeed-test-job1"
    },
)
```

#### curl

```curl
curl -X PUT "$ELASTICSEARCH_URL/_ml/anomaly_detectors/job-01" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"analysis_config":{"bucket_span":"15m","detectors":[{"detector_description":"Sum of bytes","function":"sum","field_name":"bytes"}]},"data_description":{"time_field":"timestamp","time_format":"epoch_ms"},"analysis_limits":{"model_memory_limit":"11MB"},"model_plot_config":{"enabled":true,"annotations_enabled":true},"results_index_name":"test-job1","datafeed_config":{"indices":["kibana_sample_data_logs"],"query":{"bool":{"must":[{"match_all":{}}]}},"runtime_mappings":{"hour_of_day":{"type":"long","script":{"source":"emit(doc[' \
  "'" \
  'timestamp' \
  "'" \
  '].value.getHour());"}}},"datafeed_id":"datafeed-test-job1"}}'
```

#### Java

```java
client.ml().putJob(p -> p
    .analysisConfig(a -> a
        .bucketSpan(b -> b
            .time("15m")
        )
        .detectors(d -> d
            .detectorDescription("Sum of bytes")
            .fieldName("bytes")
            .function("sum")
        )
    )
    .analysisLimits(an -> an
        .modelMemoryLimit("11MB")
    )
    .dataDescription(d -> d
        .timeField("timestamp")
        .timeFormat("epoch_ms")
    )
    .datafeedConfig(d -> d
        .datafeedId("datafeed-test-job1")
        .indices("kibana_sample_data_logs")
        .query(q -> q
            .bool(b -> b
                .must(m -> m
                    .matchAll(ma -> ma)
                )
            )
        )
        .runtimeMappings("hour_of_day", r -> r
            .script(s -> s
                .source(so -> so
                    .scriptString("emit(doc['timestamp'].value.getHour());")
                )
            )
            .type(RuntimeFieldType.Long)
        )
    )
    .jobId("job-01")
    .modelPlotConfig(m -> m
        .annotationsEnabled(true)
        .enabled(true)
    )
    .resultsIndexName("test-job1")
);
```

#### C#

```c#
var response = await client.MachineLearning
    .PutJobAsync(jobId: "job-01", d1 => d1
        .AnalysisConfig(d2 => d2
            .BucketSpan("15m")
            .Detectors(d3 => d3
                .DetectorDescription("Sum of bytes")
                .FieldName(x => x.Bytes)
                .Function("sum")
            )
        )
        .AnalysisLimits(d2 => d2
            .ModelMemoryLimit(new ByteSize("11MB"))
        )
        .DataDescription(d2 => d2
            .TimeField(x => x.Timestamp)
            .TimeFormat("epoch_ms")
        )
        .DatafeedConfig(d2 => d2
            .DatafeedId("datafeed-test-job1")
            .Indices(new[] { "kibana_sample_data_logs" })
            .Query(d3 => d3
                .Bool(d4 => d4
                    .Must(d5 => d5
                        .MatchAll()
                    )
                )
            )
            .RuntimeMappings(d3 => d3
                .Add(global::Elastic.Clients.Elasticsearch.Infer.Field<MyDocument>(x => x.HourOfDay), d4 => d4
                    .Script(d5 => d5
                        .Source("emit(doc['timestamp'].value.getHour());")
                    )
                    .Type(RuntimeFieldType.Long)
                )
            )
        )
        .ModelPlotConfig(d2 => d2
            .AnnotationsEnabled(true)
            .Enabled(true)
        )
        .ResultsIndexName("test-job1")
    );
```

#### PHP

```php
$resp = $client->ml()->putJob([
    "job_id" => "job-01",
    "body" => [
        "analysis_config" => [
            "bucket_span" => "15m",
            "detectors" => array(
                [
                    "detector_description" => "Sum of bytes",
                    "function" => "sum",
                    "field_name" => "bytes",
                ],
            ),
        ],
        "data_description" => [
            "time_field" => "timestamp",
            "time_format" => "epoch_ms",
        ],
        "analysis_limits" => [
            "model_memory_limit" => "11MB",
        ],
        "model_plot_config" => [
            "enabled" => true,
            "annotations_enabled" => true,
        ],
        "results_index_name" => "test-job1",
        "datafeed_config" => [
            "indices" => array(
                "kibana_sample_data_logs",
            ),
            "query" => [
                "bool" => [
                    "must" => array(
                        [
                            "match_all" => new ArrayObject([]),
                        ],
                    ),
                ],
            ],
            "runtime_mappings" => [
                "hour_of_day" => [
                    "type" => "long",
                    "script" => [
                        "source" => "emit(doc['timestamp'].value.getHour());",
                    ],
                ],
            ],
            "datafeed_id" => "datafeed-test-job1",
        ],
    ],
]);
```

#### Ruby

```ruby
response = client.ml.put_job(
  job_id: "job-01",
  body: {
    "analysis_config": {
      "bucket_span": "15m",
      "detectors": [
        {
          "detector_description": "Sum of bytes",
          "function": "sum",
          "field_name": "bytes"
        }
      ]
    },
    "data_description": {
      "time_field": "timestamp",
      "time_format": "epoch_ms"
    },
    "analysis_limits": {
      "model_memory_limit": "11MB"
    },
    "model_plot_config": {
      "enabled": true,
      "annotations_enabled": true
    },
    "results_index_name": "test-job1",
    "datafeed_config": {
      "indices": [
        "kibana_sample_data_logs"
      ],
      "query": {
        "bool": {
          "must": [
            {
              "match_all": {}
            }
          ]
        }
      },
      "runtime_mappings": {
        "hour_of_day": {
          "type": "long",
          "script": {
            "source": "emit(doc['timestamp'].value.getHour());"
          }
        }
      },
      "datafeed_id": "datafeed-test-job1"
    }
  }
)
```

## Response Examples

#### Ml put job response example1

A successful response when creating an anomaly detection job and datafeed.

```json
{
  "job_id": "test-job1",
  "job_type": "anomaly_detector",
  "job_version": "8.4.0",
  "create_time": 1656087283340,
  "datafeed_config": {
    "datafeed_id": "datafeed-test-job1",
    "job_id": "test-job1",
    "authorization": {
      "roles": [
        "superuser"
      ]
    },
    "query_delay": "61499ms",
    "chunking_config": {
      "mode": "auto"
    },
    "indices_options": {
      "expand_wildcards": [
        "open"
      ],
      "ignore_unavailable": false,
      "allow_no_indices": true,
      "ignore_throttled": true
    },
    "query": {
      "bool": {
        "must": [
          {
            "match_all": {}
          }
        ]
      }
    },
    "indices": [
      "kibana_sample_data_logs"
    ],
    "scroll_size": 1000,
    "delayed_data_check_config": {
      "enabled": true
    },
    "runtime_mappings": {
      "hour_of_day": {
        "type": "long",
        "script": {
          "source": "emit(doc['timestamp'].value.getHour());"
        }
      }
    }
  },
  "analysis_config": {
    "bucket_span": "15m",
    "detectors": [
      {
        "detector_description": "Sum of bytes",
        "function": "sum",
        "field_name": "bytes",
        "detector_index": 0
      }
    ],
    "influencers": [],
    "model_prune_window": "30d"
  },
  "analysis_limits": {
    "model_memory_limit": "11mb",
    "categorization_examples_limit": 4
  },
  "data_description": {
    "time_field": "timestamp",
    "time_format": "epoch_ms"
  },
  "model_plot_config": {
    "enabled": true,
    "annotations_enabled": true
  },
  "model_snapshot_retention_days": 10,
  "daily_model_snapshot_retention_after_days": 1,
  "results_index_name": "custom-test-job1",
  "allow_lazy_open": false
}
```

