How to add index pattern for a space in Kibana

Hi, I'm trying to add an index pattern for a particular space.
I tried using the provided API, described here:

POST <kibana host>:<port>/s/<space_id>/api/index_patterns/index_pattern

But, I keep getting 404 response.
Note: I also tried using the new suggested data_view API -

POST <kibana host>:<port>/s/<space_id>/api/data_views/data_view

But got the same result (404).

I have managed to workaround this problem by creating an index pattern for the default space and then copying it from there to my other defined space using shared_objects copy API, however this is not my preferred way for doing this and I prefer the official way.

Thanks in advance for the help!

A quick update, this was my mistake - I have mistakenly did not include the 'api' keyword in the API and thus it did not work.
I can now confirm that everything works well now. Here's an example for everyone in need:

localhost:5601/logs/s/default/api/index_patterns/index_pattern

with body:

{
  "index_pattern": {
     "title": "testing"
  }
}

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