以下是我用来使一组特定用户访问以“ custom-”开头的任何索引的代码。但是我希望用户能够对ANY索引(所以是“ *”)做任何他们想做的事,除了系统索引(以“。”开头)之外。有没有办法用下面的代码(也许用正则表达式)做到这一点?我尝试了"names": [ "a-zA-Z0-9" ],"
,但是没有用。
curl -XPUT https://elasticsearch1:9200/_xpack/security/role/custom-users -u elastic -k -v -H "Content-Type: application/json" -d '
{
"indices": [{
"names": [ "custom-*" ],
"privileges": ["all"]
}],
"metadata": {
"version" : 1
}
}
'
答案 0 :(得分:0)
这有效:
{ "names": ["@&~(^..+)"], "privileges": ["all"] }