Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Machine learning anomaly detection APIs

Update filters API

New API reference

For the most up-to-date API details, refer to Machine learning anomaly detection APIs.

Updates the description of a filter, adds items, or removes items.

Request

POST _ml/filters/<filter_id>/_update

Prerequisites

Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Path parameters

<filter_id>
(Required, string) A string that uniquely identifies a filter.

Request body

add_items
(Optional, array of strings) The items to add to the filter.
description
(Optional, string) A description for the filter.
remove_items
(Optional, array of strings) The items to remove from the filter.

Examples

resp = client.ml.update_filter(
    filter_id="safe_domains",
    description="Updated list of domains",
    add_items=[
        "*.myorg.com"
    ],
    remove_items=[
        "wikipedia.org"
    ],
)
print(resp)
response = client.ml.update_filter(
  filter_id: 'safe_domains',
  body: {
    description: 'Updated list of domains',
    add_items: [
      '*.myorg.com'
    ],
    remove_items: [
      'wikipedia.org'
    ]
  }
)
puts response
const response = await client.ml.updateFilter({
  filter_id: "safe_domains",
  description: "Updated list of domains",
  add_items: ["*.myorg.com"],
  remove_items: ["wikipedia.org"],
});
console.log(response);
POST _ml/filters/safe_domains/_update
{
  "description": "Updated list of domains",
  "add_items": ["*.myorg.com"],
  "remove_items": ["wikipedia.org"]
}

The API returns the following results:

{
  "filter_id": "safe_domains",
  "description": "Updated list of domains",
  "items": ["*.google.com", "*.myorg.com"]
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/ml-update-filter.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API