Check if index pattern exists using curl

Hi i am using ansible to create index patterns and data views in elk. Before creating a data view for a index pattern i would want to check if index pattern exists.
Currently using this command

curl -I -XHEAD --write-out %{http_code} --silent --output /dev/null http://**.**.**.**:9200/indexpattern*/ -u username:pwd

If i am adding a * after index pattern name it returns a status code of 200 even if the pattern does not exist. and if i remove the star it returns 404 even if the pattern exists. the index patterns are have timestamp appended after their names so i tried using a *

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.