---
type: api
title: Update an anomaly detection job
description: Updates certain properties of an anomaly detection job.
url: https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-ml-update-job
resource: https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-ml-update-job
products:
  - Elasticsearch Serverless
---

# Update an anomaly detection job

Authentication: required

## Paths

- `POST` `/_ml/anomaly_detectors/{job_id}/_update`

#### Path parameters

- `job_id` (string) — required
  Identifier for the job.

## Description

Updates certain properties of an anomaly detection job.

## Required privileges

- Cluster privileges: `manage_ml`

## 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. If `false` and 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_limits` (object) — optional
  - `model_memory_limit` (string) — required
    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.
- `background_persist_interval` (union oneOf) — 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 value too low.
If the job is open when you make the update, you must stop the datafeed,
close the job, then reopen the job and restart the datafeed for the
changes to take effect.
  Values: `-1`, `0`
- `custom_settings` (map string to object) — optional
  Advanced configuration option. Contains custom meta data about the job.
For example, it can contain custom URL information as shown in Adding
custom URLs to machine learning results.
- `categorization_filters` (string[]) — optional
- `description` (string) — optional
  A description of the job.
- `model_plot_config` (object) — optional
  - `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) — 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_prune_window` (union oneOf) — optional
  Values: `-1`, `0`
- `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`. For jobs created
before version 7.8.0, the default value matches
`model_snapshot_retention_days`.
- `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.
- `renormalization_window_days` (number) — optional
  Advanced configuration option. The period over which adjustments to the
score are applied, as new data is seen.
- `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.
- `groups` (string[]) — optional
  A list of job groups. A job can belong to no groups or many.
- `detectors` (union oneOf) — optional
  A detector update object or an array of detector update objects.
  `object` or `object[]`
  - `detector_index` (number) — required
    A unique identifier for the detector.
This identifier is based on the order of the detectors in the `analysis_config`, starting at zero.
  - `description` (string) — optional
    A description of the detector.
  - `custom_rules` (object[]) — optional
    An array of custom rule objects, which enable you to customize the way detectors operate.
For example, a rule may dictate to the detector conditions under which results should be skipped.
Kibana refers to custom rules as job rules.
    - `actions` (enum[] · 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` (object[]) — 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) — 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) — 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 object) — 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 (object)
      - `filter_id` (string) — required
        The identifier for the filter.
      - `filter_type` (enum · 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`
- `per_partition_categorization` (object) — 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.

## Response

`application/json`

- `allow_lazy_open` (boolean)
- `analysis_config` (object)
  - `bucket_span` (union oneOf · 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.
    Values: `-1`, `0`
  - `detectors` (object[])
    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)
      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` (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.
      - `actions` (enum[] · 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` (object[])
        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)
          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)
          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 object)
        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 (object)
        - `filter_id` (string)
          The identifier for the filter.
        - `filter_type` (enum · 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)
      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)
      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)
      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)
      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[])
    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` (union oneOf)
    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.
    - **string**
    - **CategorizationAnalyzerDefinition**
      - `char_filter` (union oneOf[])
        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.
        - **string**
        - **CharFilterDefinition**
          One of:
          - **type: html_strip** (`type: html_strip`)
            - `type` (enum)
              Values: `html_strip`
            - `version` (string)
            - `escaped_tags` (string[])
          - **type: mapping** (`type: mapping`)
            - `type` (enum)
              Values: `mapping`
            - `version` (string)
            - `mappings` (string[])
            - `mappings_path` (string)
          - **type: pattern_replace** (`type: pattern_replace`)
            - `type` (enum)
              Values: `pattern_replace`
            - `version` (string)
            - `flags` (string)
            - `pattern` (string)
            - `replacement` (string)
          - **type: icu_normalizer** (`type: icu_normalizer`)
            - `type` (enum)
              Values: `icu_normalizer`
            - `version` (string)
            - `mode` (enum)
              Values: `decompose`, `compose`
            - `name` (enum)
              Values: `nfc`, `nfkc`, `nfkc_cf`
            - `unicode_set_filter` (string)
          - **type: kuromoji_iteration_mark** (`type: kuromoji_iteration_mark`)
            - `type` (enum)
              Values: `kuromoji_iteration_mark`
            - `version` (string)
            - `normalize_kana` (boolean)
            - `normalize_kanji` (boolean)
      - `filter` (union oneOf[])
        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.
        - **string**
        - **TokenFilterDefinition**
          One of:
          - **type: apostrophe** (`type: apostrophe`)
            - `type` (enum)
              Values: `apostrophe`
            - `version` (string)
          - **type: arabic_stem** (`type: arabic_stem`)
            - `type` (enum)
              Values: `arabic_stem`
            - `version` (string)
          - **type: arabic_normalization** (`type: arabic_normalization`)
            - `type` (enum)
              Values: `arabic_normalization`
            - `version` (string)
          - **type: asciifolding** (`type: asciifolding`)
            - `type` (enum)
              Values: `asciifolding`
            - `version` (string)
            - `preserve_original` (boolean | string)
              If `true`, emit both original tokens and folded tokens. Defaults to `false`.
          - **type: bengali_normalization** (`type: bengali_normalization`)
            - `type` (enum)
              Values: `bengali_normalization`
            - `version` (string)
          - **type: brazilian_stem** (`type: brazilian_stem`)
            - `type` (enum)
              Values: `brazilian_stem`
            - `version` (string)
          - **type: cjk_bigram** (`type: cjk_bigram`)
            - `type` (enum)
              Values: `cjk_bigram`
            - `version` (string)
            - `ignored_scripts` (enum[])
              Array of character scripts for which to disable bigrams.
              Values: `han`, `hangul`, `hiragana`, `katakana`
            - `output_unigrams` (boolean)
              If `true`, emit tokens in both bigram and unigram form. If `false`, a CJK character is output in unigram form when it has no adjacent characters. Defaults to `false`.
          - **type: cjk_width** (`type: cjk_width`)
            - `type` (enum)
              Values: `cjk_width`
            - `version` (string)
          - **type: classic** (`type: classic`)
            - `type` (enum)
              Values: `classic`
            - `version` (string)
          - **type: common_grams** (`type: common_grams`)
            - `type` (enum)
              Values: `common_grams`
            - `version` (string)
            - `common_words` (string[])
              A list of tokens. The filter generates bigrams for these tokens.
Either this or the `common_words_path` parameter is required.
            - `common_words_path` (string)
              Path to a file containing a list of tokens. The filter generates bigrams for these tokens.
This path must be absolute or relative to the `config` location. The file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this or the `common_words` parameter is required.
            - `ignore_case` (boolean)
              If `true`, matches for common words matching are case-insensitive. Defaults to `false`.
            - `query_mode` (boolean)
              If `true`, the filter excludes the following tokens from the output:
- Unigrams for common words
- Unigrams for terms followed by common words
Defaults to `false`. We recommend enabling this parameter for search analyzers.
          - **type: condition** (`type: condition`)
            - `type` (enum)
              Values: `condition`
            - `version` (string)
            - `filter` (string[])
              Array of token filters. If a token matches the predicate script in the `script` parameter, these filters are applied to the token in the order provided.
            - `script` (string)
              Predicate script used to apply token filters. If a token matches this script, the filters in the `filter` parameter are applied to the token.
          - **type: czech_stem** (`type: czech_stem`)
            - `type` (enum)
              Values: `czech_stem`
            - `version` (string)
          - **type: decimal_digit** (`type: decimal_digit`)
            - `type` (enum)
              Values: `decimal_digit`
            - `version` (string)
          - **type: delimited_payload** (`type: delimited_payload`)
            - `type` (enum)
              Values: `delimited_payload`
            - `version` (string)
            - `delimiter` (string)
              Character used to separate tokens from payloads. Defaults to `|`.
            - `encoding` (enum)
              Data type for the stored payload.
              Values: `int`, `float`, `identity`
          - **type: dutch_stem** (`type: dutch_stem`)
            - `type` (enum)
              Values: `dutch_stem`
            - `version` (string)
          - **type: edge_ngram** (`type: edge_ngram`)
            - `type` (enum)
              Values: `edge_ngram`
            - `version` (string)
            - `max_gram` (number)
              Maximum character length of a gram. For custom token filters, defaults to `2`. For the built-in edge_ngram filter, defaults to `1`.
            - `min_gram` (number)
              Minimum character length of a gram. Defaults to `1`.
            - `side` (enum)
              Indicates whether to truncate tokens from the `front` or `back`. Defaults to `front`.
              Values: `front`, `back`
            - `preserve_original` (boolean | string)
              Emits original token when set to `true`. Defaults to `false`.
          - **type: elision** (`type: elision`)
            - `type` (enum)
              Values: `elision`
            - `version` (string)
            - `articles` (string[])
              List of elisions to remove.
To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.
For custom `elision` filters, either this parameter or `articles_path` must be specified.
            - `articles_path` (string)
              Path to a file that contains a list of elisions to remove.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each elision in the file must be separated by a line break.
To be removed, the elision must be at the beginning of a token and be immediately followed by an apostrophe. Both the elision and apostrophe are removed.
For custom `elision` filters, either this parameter or `articles` must be specified.
            - `articles_case` (boolean | string)
              If `true`, elision matching is case insensitive. If `false`, elision matching is case sensitive. Defaults to `false`.
          - **type: fingerprint** (`type: fingerprint`)
            - `type` (enum)
              Values: `fingerprint`
            - `version` (string)
            - `max_output_size` (number)
              Maximum character length, including whitespace, of the output token. Defaults to `255`. Concatenated tokens longer than this will result in no token output.
            - `separator` (string)
              Character to use to concatenate the token stream input. Defaults to a space.
          - **type: flatten_graph** (`type: flatten_graph`)
            - `type` (enum)
              Values: `flatten_graph`
            - `version` (string)
          - **type: french_stem** (`type: french_stem`)
            - `type` (enum)
              Values: `french_stem`
            - `version` (string)
          - **type: german_normalization** (`type: german_normalization`)
            - `type` (enum)
              Values: `german_normalization`
            - `version` (string)
          - **type: german_stem** (`type: german_stem`)
            - `type` (enum)
              Values: `german_stem`
            - `version` (string)
          - **type: hindi_normalization** (`type: hindi_normalization`)
            - `type` (enum)
              Values: `hindi_normalization`
            - `version` (string)
          - **type: hunspell** (`type: hunspell`)
            - `type` (enum)
              Values: `hunspell`
            - `version` (string)
            - `dedup` (boolean)
              If `true`, duplicate tokens are removed from the filter’s output. Defaults to `true`.
            - `dictionary` (string)
              One or more `.dic` files (e.g, `en_US.dic`, my_custom.dic) to use for the Hunspell dictionary.
By default, the `hunspell` filter uses all `.dic` files in the `<$ES_PATH_CONF>/hunspell/<locale>` directory specified using the `lang`, `language`, or `locale` parameter.
            - `locale` (string)
              Locale directory used to specify the `.aff` and `.dic` files for a Hunspell dictionary.
            - `longest_only` (boolean)
              If `true`, only the longest stemmed version of each token is included in the output. If `false`, all stemmed versions of the token are included. Defaults to `false`.
          - **type: hyphenation_decompounder** (`type: hyphenation_decompounder`)
            - `type` (enum)
              Values: `hyphenation_decompounder`
            - `version` (string)
            - `max_subword_size` (number)
              Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`.
            - `min_subword_size` (number)
              Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`.
            - `min_word_size` (number)
              Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`.
            - `only_longest_match` (boolean)
              If `true`, only include the longest matching subword. Defaults to `false`.
            - `word_list` (string[])
              A list of subwords to look for in the token stream. If found, the subword is included in the token output.
Either this parameter or `word_list_path` must be specified.
            - `word_list_path` (string)
              Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this parameter or `word_list` must be specified.
            - `hyphenation_patterns_path` (string)
              Path to an Apache FOP (Formatting Objects Processor) XML hyphenation pattern file.
This path must be absolute or relative to the `config` location. Only FOP v1.2 compatible files are supported.
            - `no_sub_matches` (boolean)
              If `true`, do not match sub tokens in tokens that are in the word list. Defaults to `false`.
            - `no_overlapping_matches` (boolean)
              If `true`, do not allow overlapping tokens. Defaults to `false`.
          - **type: indic_normalization** (`type: indic_normalization`)
            - `type` (enum)
              Values: `indic_normalization`
            - `version` (string)
          - **type: keep_types** (`type: keep_types`)
            - `type` (enum)
              Values: `keep_types`
            - `version` (string)
            - `mode` (enum)
              Indicates whether to keep or remove the specified token types.
              Values: `include`, `exclude`
            - `types` (string[])
              List of token types to keep or remove.
          - **type: keep** (`type: keep`)
            - `type` (enum)
              Values: `keep`
            - `version` (string)
            - `keep_words` (string[])
              List of words to keep. Only tokens that match words in this list are included in the output.
Either this parameter or `keep_words_path` must be specified.
            - `keep_words_case` (boolean)
              If `true`, lowercase all keep words. Defaults to `false`.
            - `keep_words_path` (string)
              Path to a file that contains a list of words to keep. Only tokens that match words in this list are included in the output.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.
Either this parameter or `keep_words` must be specified.
          - **type: keyword_marker** (`type: keyword_marker`)
            - `type` (enum)
              Values: `keyword_marker`
            - `version` (string)
            - `ignore_case` (boolean)
              If `true`, matching for the `keywords` and `keywords_path` parameters ignores letter case. Defaults to `false`.
            - `keywords` (union string | string[])
              Array of keywords. Tokens that match these keywords are not stemmed.
This parameter, `keywords_path`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`.
            - `keywords_path` (string)
              Path to a file that contains a list of keywords. Tokens that match these keywords are not stemmed.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each word in the file must be separated by a line break.
This parameter, `keywords`, or `keywords_pattern` must be specified. You cannot specify this parameter and `keywords_pattern`.
            - `keywords_pattern` (string)
              Java regular expression used to match tokens. Tokens that match this expression are marked as keywords and not stemmed.
This parameter, `keywords`, or `keywords_path` must be specified. You cannot specify this parameter and `keywords` or `keywords_pattern`.
          - **type: keyword_repeat** (`type: keyword_repeat`)
            - `type` (enum)
              Values: `keyword_repeat`
            - `version` (string)
          - **type: kstem** (`type: kstem`)
            - `type` (enum)
              Values: `kstem`
            - `version` (string)
          - **type: length** (`type: length`)
            - `type` (enum)
              Values: `length`
            - `version` (string)
            - `max` (number)
              Maximum character length of a token. Longer tokens are excluded from the output. Defaults to `Integer.MAX_VALUE`, which is `2^31-1` or `2147483647`.
            - `min` (number)
              Minimum character length of a token. Shorter tokens are excluded from the output. Defaults to `0`.
          - **type: limit** (`type: limit`)
            - `type` (enum)
              Values: `limit`
            - `version` (string)
            - `consume_all_tokens` (boolean)
              If `true`, the limit filter exhausts the token stream, even if the `max_token_count` has already been reached. Defaults to `false`.
            - `max_token_count` (number | string)
              Maximum number of tokens to keep. Once this limit is reached, any remaining tokens are excluded from the output. Defaults to `1`.
          - **type: lowercase** (`type: lowercase`)
            - `type` (enum)
              Values: `lowercase`
            - `version` (string)
            - `language` (enum)
              Language-specific lowercase token filter to use.
              Values: `greek`, `irish`, `turkish`
          - **type: min_hash** (`type: min_hash`)
            - `type` (enum)
              Values: `min_hash`
            - `version` (string)
            - `bucket_count` (number)
              Number of buckets to which hashes are assigned. Defaults to `512`.
            - `hash_count` (number)
              Number of ways to hash each token in the stream. Defaults to `1`.
            - `hash_set_size` (number)
              Number of hashes to keep from each bucket. Defaults to `1`.
Hashes are retained by ascending size, starting with the bucket’s smallest hash first.
            - `with_rotation` (boolean)
              If `true`, the filter fills empty buckets with the value of the first non-empty bucket to its circular right if the `hash_set_size` is `1`. If the `bucket_count` argument is greater than 1, this parameter defaults to `true`. Otherwise, this parameter defaults to `false`.
          - **type: multiplexer** (`type: multiplexer`)
            - `type` (enum)
              Values: `multiplexer`
            - `version` (string)
            - `filters` (string[])
              A list of token filters to apply to incoming tokens.
            - `preserve_original` (boolean | string)
              If `true` (the default) then emit the original token in addition to the filtered tokens.
          - **type: ngram** (`type: ngram`)
            - `type` (enum)
              Values: `ngram`
            - `version` (string)
            - `max_gram` (number)
              Maximum length of characters in a gram. Defaults to `2`.
            - `min_gram` (number)
              Minimum length of characters in a gram. Defaults to `1`.
            - `preserve_original` (boolean | string)
              Emits original token when set to `true`. Defaults to `false`.
          - **type: nori_part_of_speech** (`type: nori_part_of_speech`)
            - `type` (enum)
              Values: `nori_part_of_speech`
            - `version` (string)
            - `stoptags` (string[])
              An array of part-of-speech tags that should be removed.
          - **type: pattern_capture** (`type: pattern_capture`)
            - `type` (enum)
              Values: `pattern_capture`
            - `version` (string)
            - `patterns` (string[])
              A list of regular expressions to match.
            - `preserve_original` (boolean | string)
              If set to `true` (the default) it will emit the original token.
          - **type: pattern_replace** (`type: pattern_replace`)
            - `type` (enum)
              Values: `pattern_replace`
            - `version` (string)
            - `all` (boolean)
              If `true`, all substrings matching the pattern parameter’s regular expression are replaced. If `false`, the filter replaces only the first matching substring in each token. Defaults to `true`.
            - `flags` (string)
            - `pattern` (string)
              Regular expression, written in Java’s regular expression syntax. The filter replaces token substrings matching this pattern with the substring in the `replacement` parameter.
            - `replacement` (string)
              Replacement substring. Defaults to an empty substring (`""`).
          - **type: persian_normalization** (`type: persian_normalization`)
            - `type` (enum)
              Values: `persian_normalization`
            - `version` (string)
          - **type: persian_stem** (`type: persian_stem`)
            - `type` (enum)
              Values: `persian_stem`
            - `version` (string)
          - **type: porter_stem** (`type: porter_stem`)
            - `type` (enum)
              Values: `porter_stem`
            - `version` (string)
          - **type: predicate_token_filter** (`type: predicate_token_filter`)
            - `type` (enum)
              Values: `predicate_token_filter`
            - `version` (string)
            - `script` (string)
              Script containing a condition used to filter incoming tokens. Only tokens that match this script are included in the output.
          - **type: remove_duplicates** (`type: remove_duplicates`)
            - `type` (enum)
              Values: `remove_duplicates`
            - `version` (string)
          - **type: reverse** (`type: reverse`)
            - `type` (enum)
              Values: `reverse`
            - `version` (string)
          - **type: russian_stem** (`type: russian_stem`)
            - `type` (enum)
              Values: `russian_stem`
            - `version` (string)
          - **type: scandinavian_folding** (`type: scandinavian_folding`)
            - `type` (enum)
              Values: `scandinavian_folding`
            - `version` (string)
          - **type: scandinavian_normalization** (`type: scandinavian_normalization`)
            - `type` (enum)
              Values: `scandinavian_normalization`
            - `version` (string)
          - **type: serbian_normalization** (`type: serbian_normalization`)
            - `type` (enum)
              Values: `serbian_normalization`
            - `version` (string)
          - **type: shingle** (`type: shingle`)
            - `type` (enum)
              Values: `shingle`
            - `version` (string)
            - `filler_token` (string)
              String used in shingles as a replacement for empty positions that do not contain a token. This filler token is only used in shingles, not original unigrams. Defaults to an underscore (`_`).
            - `max_shingle_size` (number | string)
              Maximum number of tokens to concatenate when creating shingles. Defaults to `2`.
            - `min_shingle_size` (number | string)
              Minimum number of tokens to concatenate when creating shingles. Defaults to `2`.
            - `output_unigrams` (boolean)
              If `true`, the output includes the original input tokens. If `false`, the output only includes shingles; the original input tokens are removed. Defaults to `true`.
            - `output_unigrams_if_no_shingles` (boolean)
              If `true`, the output includes the original input tokens only if no shingles are produced; if shingles are produced, the output only includes shingles. Defaults to `false`.
            - `token_separator` (string)
              Separator used to concatenate adjacent tokens to form a shingle. Defaults to a space (`" "`).
          - **type: snowball** (`type: snowball`)
            - `type` (enum)
              Values: `snowball`
            - `version` (string)
            - `language` (enum)
              Controls the language used by the stemmer.
              Values: `Arabic`, `Armenian`, `Basque`, `Catalan`, `Danish`, `Dutch`, `English`, `Estonian`, `Finnish`, `French`, `German`, `German2`, `Hungarian`, `Italian`, `Irish`, `Kp`, `Lithuanian`, `Lovins`, `Norwegian`, `Porter`, `Portuguese`, `Romanian`, `Russian`, `Serbian`, `Spanish`, `Swedish`, `Turkish`
          - **type: sorani_normalization** (`type: sorani_normalization`)
            - `type` (enum)
              Values: `sorani_normalization`
            - `version` (string)
          - **type: stemmer_override** (`type: stemmer_override`)
            - `type` (enum)
              Values: `stemmer_override`
            - `version` (string)
            - `rules` (string[])
              A list of mapping rules to use.
            - `rules_path` (string)
              A path (either relative to `config` location, or absolute) to a list of mappings.
          - **type: stemmer** (`type: stemmer`)
            - `type` (enum)
              Values: `stemmer`
            - `version` (string)
            - `language` (string)
          - **type: stop** (`type: stop`)
            - `type` (enum)
              Values: `stop`
            - `version` (string)
            - `ignore_case` (boolean)
              If `true`, stop word matching is case insensitive. For example, if `true`, a stop word of the matches and removes `The`, `THE`, or `the`. Defaults to `false`.
            - `remove_trailing` (boolean)
              If `true`, the last token of a stream is removed if it’s a stop word. Defaults to `true`.
            - `stopwords` (union oneOf)
              Language value, such as `_arabic_` or `_thai_`. Defaults to `_english_`.
              Values: `_arabic_`, `_armenian_`, `_basque_`, `_bengali_`, `_brazilian_`, `_bulgarian_`, `_catalan_`, `_cjk_`, `_czech_`, `_danish_`, `_dutch_`, `_english_`, `_estonian_`, `_finnish_`, `_french_`, `_galician_`, `_german_`, `_greek_`, `_hindi_`, `_hungarian_`, `_indonesian_`, `_irish_`, `_italian_`, `_latvian_`, `_lithuanian_`, `_norwegian_`, `_persian_`, `_portuguese_`, `_romanian_`, `_russian_`, `_serbian_`, `_sorani_`, `_spanish_`, `_swedish_`, `_thai_`, `_turkish_`, `_none_`
            - `stopwords_path` (string)
              Path to a file that contains a list of stop words to remove.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each stop word in the file must be separated by a line break.
          - **type: synonym_graph** (`type: synonym_graph`)
            - `type` (enum)
              Values: `synonym_graph`
            - `version` (string)
            - `expand` (boolean)
              Expands definitions for equivalent synonym rules. Defaults to `true`.
            - `format` (enum)
              Sets the synonym rules format.
              Values: `solr`, `wordnet`
            - `lenient` (boolean)
              If `true` ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the `updateable` setting.
            - `synonyms` (string[])
              Used to define inline synonyms.
            - `synonyms_path` (string)
              Used to provide a synonym file. This path must be absolute or relative to the `config` location.
            - `synonyms_set` (union string | string[])
              Provide one or more synonym sets created through the Synonyms Management APIs. Maximum 100 sets per filter.
            - `tokenizer` (string) — deprecated
              Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.
            - `updateable` (boolean)
              If `true` allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to `false`.
          - **type: synonym** (`type: synonym`)
            - `type` (enum)
              Values: `synonym`
            - `version` (string)
            - `expand` (boolean)
              Expands definitions for equivalent synonym rules. Defaults to `true`.
            - `format` (enum)
              Sets the synonym rules format.
              Values: `solr`, `wordnet`
            - `lenient` (boolean)
              If `true` ignores errors while parsing the synonym rules. It is important to note that only those synonym rules which cannot get parsed are ignored. Defaults to the value of the `updateable` setting.
            - `synonyms` (string[])
              Used to define inline synonyms.
            - `synonyms_path` (string)
              Used to provide a synonym file. This path must be absolute or relative to the `config` location.
            - `synonyms_set` (union string | string[])
              Provide one or more synonym sets created through the Synonyms Management APIs. Maximum 100 sets per filter.
            - `tokenizer` (string) — deprecated
              Controls the tokenizers that will be used to tokenize the synonym, this parameter is for backwards compatibility for indices that created before 6.0.
            - `updateable` (boolean)
              If `true` allows reloading search analyzers to pick up changes to synonym files. Only to be used for search analyzers. Defaults to `false`.
          - **type: trim** (`type: trim`)
            - `type` (enum)
              Values: `trim`
            - `version` (string)
          - **type: truncate** (`type: truncate`)
            - `type` (enum)
              Values: `truncate`
            - `version` (string)
            - `length` (number)
              Character limit for each token. Tokens exceeding this limit are truncated. Defaults to `10`.
          - **type: unique** (`type: unique`)
            - `type` (enum)
              Values: `unique`
            - `version` (string)
            - `only_on_same_position` (boolean)
              If `true`, only remove duplicate tokens in the same position. Defaults to `false`.
          - **type: uppercase** (`type: uppercase`)
            - `type` (enum)
              Values: `uppercase`
            - `version` (string)
          - **type: word_delimiter_graph** (`type: word_delimiter_graph`)
            - `type` (enum)
              Values: `word_delimiter_graph`
            - `version` (string)
            - `catenate_all` (boolean)
              If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `catenate_numbers` (boolean)
              If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `catenate_words` (boolean)
              If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `generate_number_parts` (boolean)
              If `true`, the filter includes tokens consisting of only numeric characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.
            - `generate_word_parts` (boolean)
              If `true`, the filter includes tokens consisting of only alphabetical characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.
            - `preserve_original` (boolean | string)
              If `true`, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to `false`.
            - `protected_words` (string[])
              Array of tokens the filter won’t split.
            - `protected_words_path` (string)
              Path to a file that contains a list of tokens the filter won’t split.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
            - `split_on_case_change` (boolean)
              If `true`, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to `true`.
            - `split_on_numerics` (boolean)
              If `true`, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to `true`.
            - `stem_english_possessive` (boolean)
              If `true`, the filter removes the English possessive (`'s`) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to `true`.
            - `type_table` (string[])
              Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
            - `type_table_path` (string)
              Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
            - `adjust_offsets` (boolean)
              If `true`, the filter adjusts the offsets of split or catenated tokens to better reflect their actual position in the token stream. Defaults to `true`.
            - `ignore_keywords` (boolean)
              If `true`, the filter skips tokens with a keyword attribute of true. Defaults to `false`.
          - **type: word_delimiter** (`type: word_delimiter`)
            - `type` (enum)
              Values: `word_delimiter`
            - `version` (string)
            - `catenate_all` (boolean)
              If `true`, the filter produces catenated tokens for chains of alphanumeric characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `catenate_numbers` (boolean)
              If `true`, the filter produces catenated tokens for chains of numeric characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `catenate_words` (boolean)
              If `true`, the filter produces catenated tokens for chains of alphabetical characters separated by non-alphabetic delimiters. Defaults to `false`.
            - `generate_number_parts` (boolean)
              If `true`, the filter includes tokens consisting of only numeric characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.
            - `generate_word_parts` (boolean)
              If `true`, the filter includes tokens consisting of only alphabetical characters in the output. If `false`, the filter excludes these tokens from the output. Defaults to `true`.
            - `preserve_original` (boolean | string)
              If `true`, the filter includes the original version of any split tokens in the output. This original version includes non-alphanumeric delimiters. Defaults to `false`.
            - `protected_words` (string[])
              Array of tokens the filter won’t split.
            - `protected_words_path` (string)
              Path to a file that contains a list of tokens the filter won’t split.
This path must be absolute or relative to the `config` location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
            - `split_on_case_change` (boolean)
              If `true`, the filter splits tokens at letter case transitions. For example: camelCase -> [ camel, Case ]. Defaults to `true`.
            - `split_on_numerics` (boolean)
              If `true`, the filter splits tokens at letter-number transitions. For example: j2se -> [ j, 2, se ]. Defaults to `true`.
            - `stem_english_possessive` (boolean)
              If `true`, the filter removes the English possessive (`'s`) from the end of each token. For example: O'Neil's -> [ O, Neil ]. Defaults to `true`.
            - `type_table` (string[])
              Array of custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
            - `type_table_path` (string)
              Path to a file that contains custom type mappings for characters. This allows you to map non-alphanumeric characters as numeric or alphanumeric to avoid splitting on those characters.
          - **type: ja_stop** (`type: ja_stop`)
            - `type` (enum)
              Values: `ja_stop`
            - `version` (string)
            - `stopwords` (union oneOf)
              Values: `_arabic_`, `_armenian_`, `_basque_`, `_bengali_`, `_brazilian_`, `_bulgarian_`, `_catalan_`, `_cjk_`, `_czech_`, `_danish_`, `_dutch_`, `_english_`, `_estonian_`, `_finnish_`, `_french_`, `_galician_`, `_german_`, `_greek_`, `_hindi_`, `_hungarian_`, `_indonesian_`, `_irish_`, `_italian_`, `_latvian_`, `_lithuanian_`, `_norwegian_`, `_persian_`, `_portuguese_`, `_romanian_`, `_russian_`, `_serbian_`, `_sorani_`, `_spanish_`, `_swedish_`, `_thai_`, `_turkish_`, `_none_`
          - **type: kuromoji_stemmer** (`type: kuromoji_stemmer`)
            - `type` (enum)
              Values: `kuromoji_stemmer`
            - `version` (string)
            - `minimum_length` (number)
          - **type: kuromoji_readingform** (`type: kuromoji_readingform`)
            - `type` (enum)
              Values: `kuromoji_readingform`
            - `version` (string)
            - `use_romaji` (boolean)
          - **type: kuromoji_part_of_speech** (`type: kuromoji_part_of_speech`)
            - `type` (enum)
              Values: `kuromoji_part_of_speech`
            - `version` (string)
            - `stoptags` (string[])
          - **type: icu_collation** (`type: icu_collation`)
            - `type` (enum)
              Values: `icu_collation`
            - `version` (string)
            - `alternate` (enum)
              Values: `shifted`, `non-ignorable`
            - `caseFirst` (enum)
              Values: `lower`, `upper`
            - `caseLevel` (boolean)
            - `country` (string)
            - `decomposition` (enum)
              Values: `no`, `identical`
            - `hiraganaQuaternaryMode` (boolean)
            - `language` (string)
            - `numeric` (boolean)
            - `rules` (string)
            - `strength` (enum)
              Values: `primary`, `secondary`, `tertiary`, `quaternary`, `identical`
            - `variableTop` (string)
            - `variant` (string)
          - **type: icu_folding** (`type: icu_folding`)
            - `type` (enum)
              Values: `icu_folding`
            - `version` (string)
            - `unicode_set_filter` (string)
          - **type: icu_normalizer** (`type: icu_normalizer`)
            - `type` (enum)
              Values: `icu_normalizer`
            - `version` (string)
            - `name` (enum)
              Values: `nfc`, `nfkc`, `nfkc_cf`
          - **type: icu_transform** (`type: icu_transform`)
            - `type` (enum)
              Values: `icu_transform`
            - `version` (string)
            - `dir` (enum)
              Values: `forward`, `reverse`
            - `id` (string)
          - **type: phonetic** (`type: phonetic`)
            - `type` (enum)
              Values: `phonetic`
            - `version` (string)
            - `encoder` (enum)
              Values: `metaphone`, `double_metaphone`, `soundex`, `refined_soundex`, `caverphone1`, `caverphone2`, `cologne`, `nysiis`, `koelnerphonetik`, `haasephonetik`, `beider_morse`, `daitch_mokotoff`
            - `languageset` (union enum | enum[])
              

Supported values include: `any`, `common`, `cyrillic`, `english`, `french`, `german`, `hebrew`, `hungarian`, `polish`, `romanian`, `russian`, `spanish`
              Values: `any`, `common`, `cyrillic`, `english`, `french`, `german`, `hebrew`, `hungarian`, `polish`, `romanian`, `russian`, `spanish`
            - `max_code_len` (number)
            - `name_type` (enum)
              Values: `generic`, `ashkenazi`, `sephardic`
            - `replace` (boolean)
            - `rule_type` (enum)
              Values: `approx`, `exact`
          - **type: dictionary_decompounder** (`type: dictionary_decompounder`)
            - `type` (enum)
              Values: `dictionary_decompounder`
            - `version` (string)
            - `max_subword_size` (number)
              Maximum subword character length. Longer subword tokens are excluded from the output. Defaults to `15`.
            - `min_subword_size` (number)
              Minimum subword character length. Shorter subword tokens are excluded from the output. Defaults to `2`.
            - `min_word_size` (number)
              Minimum word character length. Shorter word tokens are excluded from the output. Defaults to `5`.
            - `only_longest_match` (boolean)
              If `true`, only include the longest matching subword. Defaults to `false`.
            - `word_list` (string[])
              A list of subwords to look for in the token stream. If found, the subword is included in the token output.
Either this parameter or `word_list_path` must be specified.
            - `word_list_path` (string)
              Path to a file that contains a list of subwords to find in the token stream. If found, the subword is included in the token output.
This path must be absolute or relative to the config location, and the file must be UTF-8 encoded. Each token in the file must be separated by a line break.
Either this parameter or `word_list` must be specified.
      - `tokenizer` (union oneOf)
        The name or definition of the 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_standard` that tokenizes in a way that has been determined to produce good categorization results on a variety of log file formats for logs in English. If you want to use that tokenizer but change the character or token filters, specify "tokenizer": "ml_standard" in your `categorization_analyzer`. Additionally, the `ml_classic` tokenizer is available, which tokenizes in the same way as the non-customizable tokenizer in old versions of the product (before 6.2). `ml_classic` was the default categorization tokenizer in versions 6.2 to 7.13, so if you need categorization identical to the default for jobs created in these versions, specify "tokenizer": "ml_classic" in your `categorization_analyzer`.
        - **string**
        - **TokenizerDefinition**
          One of:
          - **type: char_group** (`type: char_group`)
            - `type` (enum)
              Values: `char_group`
            - `version` (string)
            - `tokenize_on_chars` (string[])
            - `max_token_length` (number)
          - **type: classic** (`type: classic`)
            - `type` (enum)
              Values: `classic`
            - `version` (string)
            - `max_token_length` (number)
          - **type: edge_ngram** (`type: edge_ngram`)
            - `type` (enum)
              Values: `edge_ngram`
            - `version` (string)
            - `custom_token_chars` (string)
            - `max_gram` (number)
            - `min_gram` (number)
            - `token_chars` (enum[] · default: [])
              Values: `letter`, `digit`, `whitespace`, `punctuation`, `symbol`, `custom`
          - **type: keyword** (`type: keyword`)
            - `type` (enum)
              Values: `keyword`
            - `version` (string)
            - `buffer_size` (number · default: 256)
          - **type: letter** (`type: letter`)
            - `type` (enum)
              Values: `letter`
            - `version` (string)
          - **type: lowercase** (`type: lowercase`)
            - `type` (enum)
              Values: `lowercase`
            - `version` (string)
          - **type: ngram** (`type: ngram`)
            - `type` (enum)
              Values: `ngram`
            - `version` (string)
            - `custom_token_chars` (string)
            - `max_gram` (number)
            - `min_gram` (number)
            - `token_chars` (enum[] · default: [])
              Values: `letter`, `digit`, `whitespace`, `punctuation`, `symbol`, `custom`
          - **type: path_hierarchy** (`type: path_hierarchy`)
            - `type` (enum)
              Values: `path_hierarchy`
            - `version` (string)
            - `buffer_size` (number | string)
            - `delimiter` (string)
            - `replacement` (string)
            - `reverse` (boolean | string)
            - `skip` (number | string)
          - **type: pattern** (`type: pattern`)
            - `type` (enum)
              Values: `pattern`
            - `version` (string)
            - `flags` (string)
            - `group` (number)
            - `pattern` (string)
          - **type: simple_pattern** (`type: simple_pattern`)
            - `type` (enum)
              Values: `simple_pattern`
            - `version` (string)
            - `pattern` (string)
          - **type: simple_pattern_split** (`type: simple_pattern_split`)
            - `type` (enum)
              Values: `simple_pattern_split`
            - `version` (string)
            - `pattern` (string)
          - **type: standard** (`type: standard`)
            - `type` (enum)
              Values: `standard`
            - `version` (string)
            - `max_token_length` (number)
          - **type: thai** (`type: thai`)
            - `type` (enum)
              Values: `thai`
            - `version` (string)
          - **type: uax_url_email** (`type: uax_url_email`)
            - `type` (enum)
              Values: `uax_url_email`
            - `version` (string)
            - `max_token_length` (number)
          - **type: whitespace** (`type: whitespace`)
            - `type` (enum)
              Values: `whitespace`
            - `version` (string)
            - `max_token_length` (number)
          - **type: icu_tokenizer** (`type: icu_tokenizer`)
            - `type` (enum)
              Values: `icu_tokenizer`
            - `version` (string)
            - `rule_files` (string)
          - **type: kuromoji_tokenizer** (`type: kuromoji_tokenizer`)
            - `type` (enum)
              Values: `kuromoji_tokenizer`
            - `version` (string)
            - `discard_punctuation` (boolean)
            - `mode` (enum)
              Values: `normal`, `search`, `extended`
            - `nbest_cost` (number)
            - `nbest_examples` (string)
            - `user_dictionary` (string)
            - `user_dictionary_rules` (string[])
            - `discard_compound_token` (boolean)
          - **type: nori_tokenizer** (`type: nori_tokenizer`)
            - `type` (enum)
              Values: `nori_tokenizer`
            - `version` (string)
            - `decompound_mode` (enum)
              Values: `discard`, `none`, `mixed`
            - `discard_punctuation` (boolean)
            - `user_dictionary` (string)
            - `user_dictionary_rules` (string[])
  - `categorization_field_name` (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`.
  - `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` (union oneOf · 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.
    Values: `-1`, `0`
  - `model_prune_window` (union oneOf)
    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`.
    Values: `-1`, `0`
  - `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` (object)
    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)
    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` (object)
  - `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 · 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` (union oneOf)
  Values: `-1`, `0`
- `create_time` (number)
- `finished_time` (number)
- `custom_settings` (map string to string)
- `daily_model_snapshot_retention_after_days` (number)
- `data_description` (object)
  - `format` (string)
    Only JSON format is supported at this time.
  - `time_field` (string · 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` (object)
  - `aggregations` (map string to {} Aggregation)
    See [Aggregation](https://www.elastic.co/docs/api/doc/elasticsearch-serverless/types/_types-aggregations-aggregationcontainer)
  - `authorization` (object)
    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` (object)
      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` (object)
    - `mode` (enum)
      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` (union oneOf · default: 3h)
      The time span that each search will be querying. This setting is applicable only when the `mode` is set to `manual`.
      Values: `-1`, `0`
  - `datafeed_id` (string)
  - `frequency` (union oneOf)
    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.
    Values: `-1`, `0`
  - `indices` (string[])
  - `indexes` (string[])
  - `job_id` (string)
  - `max_empty_searches` (number)
  - `query` ({} Query)
    See [Query](https://www.elastic.co/docs/api/doc/elasticsearch-serverless/types/_types-query_dsl-querycontainer)
  - `query_delay` (union oneOf)
    Values: `-1`, `0`
  - `script_fields` (map string to object)
    Map values (object)
    - `script` (string)
    - `ignore_failure` (boolean)
  - `scroll_size` (number)
  - `delayed_data_check_config` (object)
    - `check_window` (union oneOf)
      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`.
      Values: `-1`, `0`
    - `enabled` (boolean)
      Specifies whether the datafeed periodically checks for delayed data.
  - `runtime_mappings` (object)
  - `indices_options` (object)
    - `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` (union oneOf)
      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.
- `description` (string)
- `groups` (string[])
- `job_id` (string)
- `job_type` (string)
- `job_version` (string)
- `model_plot_config` (object)
  - `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)
    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)
- `model_snapshot_retention_days` (number)
- `renormalization_window_days` (number)
- `results_index_name` (string)
- `results_retention_days` (number)
## Code examples

#### Console

```console
POST _ml/anomaly_detectors/low_request_rate/_update
{
  "description":"An updated job",
  "detectors": {
    "detector_index": 0,
    "description": "An updated detector description"
  },
  "groups": ["kibana_sample_data","kibana_sample_web_logs"],
  "model_plot_config": {
    "enabled": true
  },
  "renormalization_window_days": 30,
  "background_persist_interval": "2h",
  "model_snapshot_retention_days": 7,
  "results_retention_days": 60
}
```

#### JavaScript

```javascript
const response = await client.ml.updateJob({
  job_id: "low_request_rate",
  description: "An updated job",
  detectors: {
    detector_index: 0,
    description: "An updated detector description",
  },
  groups: ["kibana_sample_data", "kibana_sample_web_logs"],
  model_plot_config: {
    enabled: true,
  },
  renormalization_window_days: 30,
  background_persist_interval: "2h",
  model_snapshot_retention_days: 7,
  results_retention_days: 60,
});
```

#### Python

```python
resp = client.ml.update_job(
    job_id="low_request_rate",
    description="An updated job",
    detectors={
        "detector_index": 0,
        "description": "An updated detector description"
    },
    groups=[
        "kibana_sample_data",
        "kibana_sample_web_logs"
    ],
    model_plot_config={
        "enabled": True
    },
    renormalization_window_days=30,
    background_persist_interval="2h",
    model_snapshot_retention_days=7,
    results_retention_days=60,
)
```

#### curl

```curl
curl -X POST "$ELASTICSEARCH_URL/_ml/anomaly_detectors/low_request_rate/_update" \
  -H "Authorization: ApiKey $ELASTIC_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "An updated job",
    "detectors": {
      "detector_index": 0,
      "description": "An updated detector description"
    },
    "groups": [
      "kibana_sample_data",
      "kibana_sample_web_logs"
    ],
    "model_plot_config": {
      "enabled": true
    },
    "renormalization_window_days": 30,
    "background_persist_interval": "2h",
    "model_snapshot_retention_days": 7,
    "results_retention_days": 60
  }'
```

#### Java

```java
client.ml().updateJob(u -> u
    .backgroundPersistInterval(b -> b
        .time("2h")
    )
    .description("An updated job")
    .detectors(d -> d
        .detectorIndex(0)
        .description("An updated detector description")
    )
    .groups(List.of("kibana_sample_data","kibana_sample_web_logs"))
    .jobId("low_request_rate")
    .modelPlotConfig(m -> m
        .enabled(true)
    )
    .modelSnapshotRetentionDays(7L)
    .renormalizationWindowDays(30L)
    .resultsRetentionDays(60L)
);
```

#### C#

```c#
var response = await client.MachineLearning
    .UpdateJobAsync(jobId: "low_request_rate", d1 => d1
        .BackgroundPersistInterval("2h")
        .Description("An updated job")
        .Detectors(d2 => d2
            .Description("An updated detector description")
            .DetectorIndex(0)
        )
        .Groups("kibana_sample_data", "kibana_sample_web_logs")
        .ModelPlotConfig(d2 => d2
            .Enabled(true)
        )
        .ModelSnapshotRetentionDays(7L)
        .RenormalizationWindowDays(30L)
        .ResultsRetentionDays(60L)
    );
```

#### PHP

```php
$resp = $client->ml()->updateJob([
    "job_id" => "low_request_rate",
    "body" => [
        "description" => "An updated job",
        "detectors" => [
            "detector_index" => 0,
            "description" => "An updated detector description",
        ],
        "groups" => array(
            "kibana_sample_data",
            "kibana_sample_web_logs",
        ),
        "model_plot_config" => [
            "enabled" => true,
        ],
        "renormalization_window_days" => 30,
        "background_persist_interval" => "2h",
        "model_snapshot_retention_days" => 7,
        "results_retention_days" => 60,
    ],
]);
```

#### Ruby

```ruby
response = client.ml.update_job(
  job_id: "low_request_rate",
  body: {
    "description": "An updated job",
    "detectors": {
      "detector_index": 0,
      "description": "An updated detector description"
    },
    "groups": [
      "kibana_sample_data",
      "kibana_sample_web_logs"
    ],
    "model_plot_config": {
      "enabled": true
    },
    "renormalization_window_days": 30,
    "background_persist_interval": "2h",
    "model_snapshot_retention_days": 7,
    "results_retention_days": 60
  }
)
```

## Response examples

#### 200

`application/json`

Generated from the API spec. Values are representative. Unions use the first variant; deeply nested or large bodies may omit fields.

```json
{
  "allow_lazy_open": false,
  "analysis_config": {
    "bucket_span": "5m",
    "detectors": [
      {
        "function": "string",
        "by_field_name": "string",
        "custom_rules": [
          {
            "actions": [
              "skip_result"
            ]
          }
        ],
        "detector_description": "string",
        "detector_index": 0,
        "exclude_frequent": "all",
        "field_name": "string",
        "over_field_name": "string",
        "partition_field_name": "string",
        "use_null": false
      }
    ],
    "influencers": [
      "string"
    ],
    "categorization_analyzer": "string",
    "categorization_field_name": "string",
    "categorization_filters": [
      "string"
    ],
    "latency": "0",
    "model_prune_window": "string",
    "multivariate_by_fields": false,
    "per_partition_categorization": {
      "enabled": false,
      "stop_on_warn": false
    },
    "summary_count_field_name": "string"
  },
  "analysis_limits": {
    "categorization_examples_limit": 4,
    "model_memory_limit": "1024mb"
  },
  "background_persist_interval": "string",
  "create_time": 0,
  "finished_time": 0,
  "custom_settings": {
    "key": "string"
  },
  "daily_model_snapshot_retention_after_days": 0,
  "data_description": {
    "format": "string",
    "time_field": "time",
    "time_format": "epoch",
    "field_delimiter": "string"
  },
  "datafeed_config": {
    "aggregations": {
      "key": {
        "aggregations": {
          "key": {}
        },
        "meta": {
          "key": {}
        },
        "adjacency_matrix": {
          "filters": {},
          "separator": "string"
        },
        "auto_date_histogram": {
          "buckets": 10,
          "field": "string",
          "format": "string",
          "minimum_interval": "second",
          "offset": "string",
          "params": {},
          "script": {
            "lang": "painless"
          },
          "time_zone": "string"
        },
        "avg": {
          "field": "string",
          "missing": "string",
          "script": {
            "lang": "painless"
          },
          "format": "string"
        },
        "avg_bucket": {
          "format": "string",
          "gap_policy": "skip"
        },
        "boxplot": {
          "field": "string"
        }
      }
    }
  }
}
```

