Skip to content
Advertisement

How to create Index pattern using API and Index Name

I created Indices by Elasticsearch API, to create visualization I need the index pattern ID of that particular index. Is there a possible way to create an index pattern using API

Advertisement

Answer

Yes, you can create an index pattern via the Saved Object API.

$ curl -X POST <kibana-host>:<port>/api/saved_objects/index-pattern/index-pattern-id  -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
  "attributes": {
    "title": "my-index-*"
  }
}'
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement