So I'm trying to write a search_spec.json file to exclude all docker images with path */latest or */develop im my artifactory repo. However I cannot find a solution to exclude multiple paths from the search results. With the current solution I'm getting a 400 from artifactory. Any ideas?
{
"files":[
{
"aql":{
"items.find":{
"repo":{
"$eq":"my-docker-repo"
},
"path":{
"$nmatch":"**/latest*",
"$nmatch":"**/develop*"
},
"updated":{
"$before":"8w"
},
"stat.downloaded":{
"$before":"12w"
}
}
},
"recursive":"true",
"sortBy":[
"created"
],
"limit":10000
}
]
}
You can use compound criteria for that, using an $and
operator.
In your example, change -
"path":{
"$nmatch":"**/latest*",
"$nmatch":"**/develop*"
},
to -
"$and":[
{
"path":{
"$nmatch":"**/latest*"
}
},{
"path":{
"$nmatch":"**/develop*"
}
}
],