Kibana index pattern creation through UI and REST leading to duplicates

Found similar issue reported in Same index-pattern created with kibana UI and REST command which got auto-closed due to lack of response.

Version: Kibana-oss 7.10.2
Issue: Say an index pattern say journal-2021.07.27 is created through Stack management page of Kibana UI.
Next, if using the kibana saved objects REST API, an index pattern with same name is created:

curl -XPOST http://localhost:5601/api/saved_objects/index-pattern/journal-2021.07.27 -H 'kbn-xsrf: true' -H 'Content-type: application/json' -d'{"attributes": {"title" : "journal-2021.07.27"}}'
Response -> {"type":"index-pattern","id":"journal-2021.07.27","attributes":{"title":"journal-2021.07.27"},"references":,"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2021-07-29T05:19:30.633Z","version":"WzQsMV0="}

This creates two index patterns in kibana with exact same name, which is not expected and seems like a bug.

Any suggestions if its already fixed in recent versions of kibana?

Saved objects API bypasses any application level logic, so there is no way for index pattern code to check if there is no existing index pattern with the same pattern when using this API.

We recommend using higher level API for this: Index patterns APIs | Kibana Guide [7.16] | Elastic

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