# Same index pattern in multiple namespaces

**URL:** https://discuss.elastic.co/t/same-index-pattern-in-multiple-namespaces/316085
**Category:** Kibana
**Created:** [October 7, 2022, 1:46pm UTC](https://discuss.elastic.co/t/same-index-pattern-in-multiple-namespaces/316085 "2022-10-07T13:46:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![umesh2020](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/umesh2020/32/126038_2.png) [@umesh2020](https://discuss.elastic.co/u/umesh2020)
#### Post date: [October 7, 2022, 1:46pm UTC](https://discuss.elastic.co/t/same-index-pattern-in-multiple-namespaces/316085/1 "2022-10-07T13:46:56Z")

</div>

Hi  
I am using Kibana/Elasticsearch version 7.16.3. I have trouble creating the same index pattern within multiple namespaces. I am using bulk create API to create multiple index patterns and for one of the patterns which is present in another namespace, I am getting status code 409 with error indicating there is Conflict and the index pattern is not over writable.

```auto
  json:
    saved_objects:
    - attributes:
        timeFieldName: '@timestamp'
        title: fi5-dev-*
      coreMigrationVersion: 8.4.2
      id: fi5-dev-pattern
      migrationVersion:
        index-pattern: 8.0.0
      namespaces:
      - fi5-dev-space
      references: []
      type: index-pattern
      updated_at: '2022-10-06T19:41:59.897Z'
      version: WzU0MzAxLDRd
    - error:
        error: Conflict
        message: Saved object [index-pattern/shared-dev-pattern] conflict
        metadata:
          isNotOverwritable: true
        statusCode: 409
      id: shared-dev-pattern
      type: index-pattern

```

I am calling [https://localhost:5601/s/fi5-dev-space/api/saved\_objects/\_bulk\_create](https://localhost:5601/s/fi5-dev-space/api/saved_objects/_bulk_create) to create the index pattern with following attributes

```auto
[
  {
    "type": "index-pattern",
    "id": "fi5-dev-index-pattern",
    "attributes": {
      "title": "fi5-dev-*",
      "timeFieldName": "@timestamp",
      "initialNamespaces": "fi5-dev-space"
    }
  },
  {
    "type": "index-pattern",
    "id": "shared-index-pattern",
    "attributes": {
      "title": "shared-dev-*",
      "timeFieldName": "@timestamp",
      "initialNamespaces": "fi5-dev-space"
    }
  }
]

```

The shared dev index pattern is present in another namespace fi1-dev.

```auto
{
  "saved_objects": [
    {
      "id": "shared-dev-pattern",
      "type": "index-pattern",
      "namespaces": [
        "fi1-dev-space"
      ],
      "updated_at": "2022-10-06T21:57:06.387Z",
      "version": "WzU0OTY5LDRd",
      "attributes": {
        "title": "shared-dev-*",
        "timeFieldName": "@timestamp",
        "initialNamespaces": "fi1-dev-space"
      },
      "references": [],
      "migrationVersion": {
        "index-pattern": "8.0.0"
      },
      "coreMigrationVersion": "8.4.2"
    }
  ]
}

```

Thanks for your time and Any pointers to resolve this is appreciated.

---

<div class="post-metadata">

### Author: ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)
#### Post date: [October 10, 2022, 7:07am UTC](https://discuss.elastic.co/t/same-index-pattern-in-multiple-namespaces/316085/2 "2022-10-10T07:07:26Z")

</div>

Ids of `index-pattern` saved objects need to be unique even across spaces. Make sure to use a different id per space.

Alternatively you can create a single `index-pattern` and list all the spaces you want it to be available in the `initialNamespaces` property: [Create saved objects API | Kibana Guide [master] | Elastic](https://www.elastic.co/guide/en/kibana/master/saved-objects-api-create.html)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [November 7, 2022, 7:08am UTC](https://discuss.elastic.co/t/same-index-pattern-in-multiple-namespaces/316085/3 "2022-11-07T07:08:26Z")

</div>

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