Same index-pattern created with kibana UI and REST command

Hi

We have deployed kibana 7.8.0. We notice one observation if we try to create one index pattern through Kibana UI and another through REST API in that case we are able to create the same index-pattern. But if we try to create the same index pattern in UI or by REST API it does not allows us to create.
Please refer the sample output of REST API

[root@nc0515node02 ~]# 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"}}'
{"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="}

[root@nc0515node02 ~]# 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"}}'
{"statusCode":409,"error":"Conflict","message":"[index-pattern:journal-2021.07.27]: version conflict, document already exists (current version [1]): [version_conflict_engine_exception] [index-pattern:journal-2021.07.27]: version conflict, document already exists (current version [1]), with { index_uuid=\"Ax0YD5PeTkWCZb7r8dkatw\" & shard=\"0\" & index=\".kibana_1\" }"}

Please refer to the below attachment having the same index pattern:-

Could you please explain this behavior?

Thanks

Hi @prashant1 ,

Correct me if I got it wrong, but you are able to create index patterns with the same title via REST API but cannot do the same via Kibana UI?
If so, I can explain it with client-side validation: when you specify a name via UI form, there is a check for existing index patterns with the same title. However, there is no such check when you add create SO via API.

Feel free to open a github issue, it sounds like an enhancement.

Regards, Dima

Hi @Dzmitry
Thanks, for the explanation.
As per the above explanation, If there are two index-pattern seen in kibana UI so one of them is created by REST API ?
Or is it possible to create two index-pattern with the same name with REST api ?

Thanks,
prashant

Hi @prashant1 ,

We expect customers to create index patterns via Kibana UI. This is the most popular way since index pattern will be used in Discover, Visualize and other apps.
By doing it via UI there shouldn't 2 index patterns with the same name - validation won't allow you, however you can create 2 that match the same index, but to have different titles.

If you ended up with 2 identical ones, not playing with API, it sounds like a bug. It should be not possible to create index patterns of the same title via API, so if you are able to - please report a bug.

Best, Dima

thanks @Dzmitry

you ended up with 2 identical ones:- no with UI the behaviour is working fine also with the api it wont allow us to create two with same titles.

Only in single case :- If one index pattern is created from UI and other one with REST api leads to two index pattern issue.

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