采用通配符的形式来删除索引,es返回报错
{
“error” : {
“root_cause” : [
{
“type” : “illegal_argument_exception”,
“reason” : “Wildcard expressions or all indices are not allowed”
}
],
“type” : “illegal_argument_exception”,
“reason” : “Wildcard expressions or all indices are not allowed”
},
“status” : 400
}

问题原因:由于es配置destructive_requires_name
为true,会禁止使用通配符的方式批量删除索引
解决方案:
1.查看es配置,执行GET /_cluster/settings

2.修改destructive_requires_name值,PUT _cluster/settings
{"persistent": {"action.destructive_requires_name":"false"}}

3.重新执行DELETE命令,则可以成功运行
