Index-pattern with same name 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

That’s pretty weird. I’ve poked around a bit and I can’t seem to duplicate based on your brief description (although I’m only testing on newer versions 7.10.2, OpenSearch 1.0)

Two things that jump out at me:

  1. When Kibana or Dashboards creates an index pattern it uses http://localhost:5601/api/saved_objects/index-pattern (no ID in the URI)
  2. When I use your format, I’m not actually seeing the index pattern show up when I query the .kibana index. What are you seeing when you query?
GET .kibana/_search/
{
    "size": 50,
    "query" : {
      "exists": {
        "field" : "index-pattern"
      }      
    }
}

I’m guessing there may be some differences of the index patterns being listed by name vs referenced by id, but seeing as I can’t recreate, I’m a bit puzzled.

Thanks @searchymcsearchface for the quick response
I have tried the same scenario :- I have created one index-pattern through kibana UI(“journal-2021.08.11”) after that with the same title i tried to create with REST api(journal-2021.08.11)

Now I can see two index-pattern in UI with same name.
The output for the GET .kibana/_search/

{
  "took" : 6,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "config:7.8.0",
        "_score" : 1.0,
        "_source" : {
          "config" : {
            "buildNum" : 32017,
            "defaultIndex" : "420bb500-fa60-11eb-8da4-1f4351d80563"
          },
          "type" : "config",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:54:51.202Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:420bb500-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.11",
            "timeFieldName" : "@timestamp",
            "fields" : """[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"audit_loginuid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"audit_loginuid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"audit_loginuid"}}},{"name":"audit_session","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"audit_session.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"audit_session"}}},{"name":"boot_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"boot_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"boot_id"}}},{"name":"cap_effective","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"cap_effective.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"cap_effective"}}},{"name":"cmdline","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"cmdline.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"cmdline"}}},{"name":"code_file","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_file.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_file"}}},{"name":"code_function","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_function.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_function"}}},{"name":"code_line","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_line.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_line"}}},{"name":"comm","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"comm.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"comm"}}},{"name":"exe","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"exe.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"exe"}}},{"name":"gid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"gid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"gid"}}},{"name":"hostname","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"hostname.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"hostname"}}},{"name":"leader","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"leader.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"leader"}}},{"name":"machine_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"machine_id"}}},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message"}}},{"name":"message_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message_id"}}},{"name":"pid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"pid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"pid"}}},{"name":"priority","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"priority.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"priority"}}},{"name":"result","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"result.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"result"}}},{"name":"selinux_context","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"selinux_context.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"selinux_context"}}},{"name":"session_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"session_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"session_id"}}},{"name":"source_monotonic_timestamp","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"source_monotonic_timestamp.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"source_monotonic_timestamp"}}},{"name":"source_realtime_timestamp","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"source_realtime_timestamp.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"source_realtime_timestamp"}}},{"name":"stream_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"stream_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"stream_id"}}},{"name":"syslog_facility","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_facility.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_facility"}}},{"name":"syslog_identifier","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_identifier.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_identifier"}}},{"name":"syslog_pid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_pid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_pid"}}},{"name":"systemd_cgroup","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_cgroup.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_cgroup"}}},{"name":"systemd_owner_uid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_owner_uid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_owner_uid"}}},{"name":"systemd_session","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_session.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_session"}}},{"name":"systemd_slice","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_slice.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_slice"}}},{"name":"systemd_unit","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_unit.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_unit"}}},{"name":"tag","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tag.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"tag"}}},{"name":"transport","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"transport.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"transport"}}},{"name":"uid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"uid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"uid"}}},{"name":"unit","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"unit.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"unit"}}},{"name":"user_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"user_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"user_id"}}}]"""
          },
          "type" : "index-pattern",
          "references" : [ ],
          "migrationVersion" : {
            "index-pattern" : "7.6.0"
          },
          "updated_at" : "2021-08-11T04:54:53.984Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "ui-metric:kibana-user_agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
        "_score" : 1.0,
        "_source" : {
          "ui-metric" : {
            "count" : 1
          },
          "type" : "ui-metric",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:55:10.484Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:4e724c50-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.4800333333333333,
            "numberOfClicks" : 6,
            "appId" : "dev_tools",
            "timestamp" : "2021-08-11T04:55:10.484Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:55:10.485Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:4e724c51-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.44321666666666665,
            "numberOfClicks" : 11,
            "appId" : "management",
            "timestamp" : "2021-08-11T04:55:10.484Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:55:10.485Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "ui-metric:console:opened_app",
        "_score" : 1.0,
        "_source" : {
          "ui-metric" : {
            "count" : 1
          },
          "type" : "ui-metric",
          "updated_at" : "2021-08-11T04:55:10.485Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:journal-2021.08.11",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.11"
          },
          "type" : "index-pattern",
          "references" : [ ],
          "migrationVersion" : {
            "index-pattern" : "7.6.0"
          },
          "updated_at" : "2021-08-11T04:56:10.685Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:7fedafe0-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.3214166666666667,
            "numberOfClicks" : 1,
            "appId" : "dev_tools",
            "timestamp" : "2021-08-11T04:56:33.502Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:56:33.502Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:9b745930-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.02665,
            "numberOfClicks" : 0,
            "appId" : "dev_tools",
            "timestamp" : "2021-08-11T04:57:19.683Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:57:19.683Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:a28b3a90-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.07941666666666666,
            "numberOfClicks" : 0,
            "appId" : "dev_tools",
            "timestamp" : "2021-08-11T04:57:31.577Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-11T04:57:31.577Z"
        }
      }
    ]
  }
}

Please refer the attachment

OK - so this makes sense. Looking at your index patterns you have two distinct patterns:

This one you created via the API and specified the API (_id and title)

 {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:journal-2021.08.11",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.11"
            ....

And this one created via Kibana (_id and title):

      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:420bb500-fa60-11eb-8da4-1f4351d80563",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.11",
            "timeFieldName" : "@timestamp",
            ....

I think you probably want to try not explicitly using the id in the path for your API request.

Hi @searchymcsearchface

We have created a index-pattern in UI.Then we have tried by creating the index without providing the id also with REST api still we are able to create same index-pattern. Below is the command used

curl -XPOST http://localhost:5601/api/saved_objects/index-pattern/ -H 'kbn-xsrf: true' -H 'Content-type: application/json' -d'{"attributes": {"title" : "journal-2021.08.12"}}'                       {"type":"index-pattern","id":"f2ce9740-fb46-11eb-b9bb-31fa5f470901","attributes":{"title":"journal-2021.08.12"},"references":[],"migrationVersion":{"index-pattern":"7.6.0"},"updated_at":"2021-08-12T08:26:10.484Z","version":"WzksMV0="}

please refer the output of .kibana/_search

{
  "took" : 6,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 8,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "config:7.8.0",
        "_score" : 1.0,
        "_source" : {
          "config" : {
            "buildNum" : 32017,
            "defaultIndex" : "28129100-fb46-11eb-b9bb-31fa5f470901"
          },
          "type" : "config",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:20:31.342Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "ui-metric:kibana-user_agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36",
        "_score" : 1.0,
        "_source" : {
          "ui-metric" : {
            "count" : 1
          },
          "type" : "ui-metric",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:20:33.387Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:28129100-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.12",
            "timeFieldName" : "@timestamp",
            "fields" : """[{"name":"@timestamp","type":"date","esTypes":["date"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true},{"name":"_id","type":"string","esTypes":["_id"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_index","type":"string","esTypes":["_index"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"_score","type":"number","count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_source","type":"_source","esTypes":["_source"],"count":0,"scripted":false,"searchable":false,"aggregatable":false,"readFromDocValues":false},{"name":"_type","type":"string","esTypes":["_type"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":false},{"name":"audit_loginuid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"audit_loginuid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"audit_loginuid"}}},{"name":"audit_session","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"audit_session.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"audit_session"}}},{"name":"boot_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"boot_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"boot_id"}}},{"name":"cap_effective","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"cap_effective.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"cap_effective"}}},{"name":"cmdline","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"cmdline.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"cmdline"}}},{"name":"code_file","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_file.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_file"}}},{"name":"code_function","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_function.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_function"}}},{"name":"code_line","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"code_line.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"code_line"}}},{"name":"comm","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"comm.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"comm"}}},{"name":"exe","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"exe.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"exe"}}},{"name":"gid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"gid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"gid"}}},{"name":"hostname","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"hostname.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"hostname"}}},{"name":"leader","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"leader.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"leader"}}},{"name":"machine_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"machine_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"machine_id"}}},{"name":"message","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message"}}},{"name":"message_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"message_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"message_id"}}},{"name":"pid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"pid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"pid"}}},{"name":"priority","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"priority.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"priority"}}},{"name":"result","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"result.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"result"}}},{"name":"selinux_context","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"selinux_context.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"selinux_context"}}},{"name":"session_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"session_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"session_id"}}},{"name":"source_monotonic_timestamp","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"source_monotonic_timestamp.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"source_monotonic_timestamp"}}},{"name":"source_realtime_timestamp","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"source_realtime_timestamp.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"source_realtime_timestamp"}}},{"name":"stream_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"stream_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"stream_id"}}},{"name":"syslog_facility","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_facility.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_facility"}}},{"name":"syslog_identifier","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_identifier.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_identifier"}}},{"name":"syslog_pid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"syslog_pid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"syslog_pid"}}},{"name":"systemd_cgroup","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_cgroup.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_cgroup"}}},{"name":"systemd_owner_uid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_owner_uid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_owner_uid"}}},{"name":"systemd_session","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_session.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_session"}}},{"name":"systemd_slice","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_slice.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_slice"}}},{"name":"systemd_unit","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"systemd_unit.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"systemd_unit"}}},{"name":"tag","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"tag.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"tag"}}},{"name":"transport","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"transport.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"transport"}}},{"name":"uid","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"uid.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"uid"}}},{"name":"unit","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"unit.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"unit"}}},{"name":"user_id","type":"string","esTypes":["text"],"count":0,"scripted":false,"searchable":true,"aggregatable":false,"readFromDocValues":false},{"name":"user_id.keyword","type":"string","esTypes":["keyword"],"count":0,"scripted":false,"searchable":true,"aggregatable":true,"readFromDocValues":true,"subType":{"multi":{"parent":"user_id"}}}]"""
          },
          "type" : "index-pattern",
          "references" : [ ],
          "migrationVersion" : {
            "index-pattern" : "7.6.0"
          },
          "updated_at" : "2021-08-12T08:20:33.382Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:29e1d2c0-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.3914166666666667,
            "numberOfClicks" : 2,
            "appId" : "log-export",
            "timestamp" : "2021-08-12T08:20:33.387Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:20:33.388Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:29e1d2c1-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.09073333333333333,
            "numberOfClicks" : 1,
            "appId" : "searchguard-login",
            "timestamp" : "2021-08-12T08:20:33.387Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:20:33.388Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:29e1d2c2-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.8084166666666667,
            "numberOfClicks" : 8,
            "appId" : "management",
            "timestamp" : "2021-08-12T08:20:33.387Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:20:33.388Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "application_usage_transactional:e0af00e0-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "application_usage_transactional" : {
            "minutesOnScreen" : 0.07628333333333333,
            "numberOfClicks" : 0,
            "appId" : "management",
            "timestamp" : "2021-08-12T08:25:40.078Z"
          },
          "type" : "application_usage_transactional",
          "references" : [ ],
          "updated_at" : "2021-08-12T08:25:40.078Z"
        }
      },
      {
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:f2ce9740-fb46-11eb-b9bb-31fa5f470901",
        "_score" : 1.0,
        "_source" : {
          "index-pattern" : {
            "title" : "journal-2021.08.12"
          },
          "type" : "index-pattern",
          "references" : [ ],
          "migrationVersion" : {
            "index-pattern" : "7.6.0"
          },
          "updated_at" : "2021-08-12T08:26:10.484Z"
        }
      }
    ]
  }
}

If we try to create same index pattern through UI it gives this error

So we have a doubt if there is already index-pattern available in kibana UI. Why it is allowing us to create the same index-pattern with same name?
The expected behavior should be like if there is already index-pattern available it should not allow to create with the same name with REST api.

Ah! I think I misunderstood what you were getting at.

So, yes the UI does an additional API check to see if there are duplicates. A mentioned earlier, I was playing around with this in 7.10.2 and OpenSearch and the behaviour is different, so perhaps it’s been fixed?

If this is a major problem for you, you could always check with another call similar to what the UI is doing. That would be similar to curl -XGET http://localhost:5601/api/saved_objects/index-pattern/journal-2021.07.27

If you want to change the behaviour, you can always put in a issue on GitHub - opensearch-project/OpenSearch-Dashboards: Open source visualization dashboards for OpenSearch.</t (this won’t change your version, but only the project moving forward).