Retrieve an index pattern's UUID

How can I create a new index pattern with a curl request?

How can I retrieve the ID of an index pattern with a curl request?

I have tried creating an index pattern with this request, but Kibana freezes when I try to view the index pattern in the Discover panel:

curl -XPOST "http://localhost:9200/.kibana/doc/index-pattern-id" -H 'Content-Type: application/json' -d'
{
  "type" : "index-pattern",
  "index-pattern" : {
    "title": "the-index-pattern*",
    "timeFieldName": "@timestamp"
  }
}'

The new index pattern appears on the right in the discover page, but when I attempt to view it, Kibana sort of freezes. (I do have indices that match the pattern)

When I do this search:

GET .kibana/_search

The index I created appears. However, it looks different from the other index patterns in that it is missing a "fields" field.

The recommended approach is to use Kibana's REST API https://www.elastic.co/guide/en/kibana/6.5/saved-objects-api.html

This is exactly what I needed. Thank you!

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