Elasticsearch 同时设置多个指数的动态索引
示例
您可以通过一个请求甚至是其中一个子集,将IndexSettings示例中显示的相同更改应用于所有现有索引:
PUT /*/_settings { "index": { "indexing.slowlog.threshold.index.warn": "1s", "search.slowlog.threshold": { "fetch.warn": "500ms", "query.warn": "2s" } } }
要么
PUT /_all/_settings { "index": { "indexing.slowlog.threshold.index.warn": "1s", "search.slowlog.threshold": { "fetch.warn": "500ms", "query.warn": "2s" } } }
要么
PUT /_settings { "index": { "indexing.slowlog.threshold.index.warn": "1s", "search.slowlog.threshold": { "fetch.warn": "500ms", "query.warn": "2s" } } }
如果您也希望有选择地这样做,那么可以选择多个而不全部提供:
PUT /logstash-*,my_other_index,some-other-*/_settings { "index": { "indexing.slowlog.threshold.index.warn": "1s", "search.slowlog.threshold": { "fetch.warn": "500ms", "query.warn": "2s" } } }