# Change visualization index under saved objects

**URL:** <https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578>\
**Category:** Kibana\
**Created:** [July 2, 2019, 7:36pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578 "2019-07-02T19:36:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 2, 2019, 7:36pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578/1 "2019-07-02T19:36:00Z")

</div>

I want to change my index for a visualization, so I went to:

`Management > Saved Objects > Visualizatio`n

but I don't what field I have to change in my `kibanaSavedObjectMeta.searchSourceJSON`

kibanaSavedObjectMeta.searchSourceJSON:

```auto
{
  "query": {
    "query": "",
    "language": "kuery"
  },
  "filter": [
    {
      "$state": {
        "store": "appState"
      },
      "meta": {
        "alias": null,
        "disabled": false,
        "key": "cloudwatch_logs.log_group",
        "negate": false,
        "params": {
          "query": "/aws/lambda/b2_record_processor"
        },
        "type": "phrase",
        "value": "/aws/lambda/b2_record_processor",
        "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index"
      },
      "query": {
        "match": {
          "cloudwatch_logs.log_group": {
            "query": "/aws/lambda/b2_record_processor",
            "type": "phrase"
          }
        }
      }
    },
    {
      "meta": {
        "alias": null,
        "negate": false,
        "type": "phrase",
        "key": "message",
        "value": "ERROR - RECPROC - PROCESS",
        "params": {
          "query": "ERROR - RECPROC - PROCESS"
        },
        "disabled": false,
        "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.filter[1].meta.index"
      },
      "query": {
        "match": {
          "message": {
            "query": "ERROR - RECPROC - PROCESS",
            "type": "phrase"
          }
        }
      },
      "$state": {
        "store": "appState"
      }
    }
  ],
  "indexRefName": "kibanaSavedObjectMeta.searchSourceJSON.index"
}

```

---

<div class="post-metadata">

**Author:** ![christophilus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christophilus/32/42991_2.png) [@christophilus](https://discuss.elastic.co/u/christophilus)\
**Post date:** [July 2, 2019, 8:32pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578/2 "2019-07-02T20:32:44Z")

</div>

There's really no first-class support for switching the index that a visualization uses. We're working on it and hope to have a beta for something like this soon, but it's not in there, yet. Probably the best thing to do is to re-create the visualization with the appropriate index.

However if you _really_ want to edit it, you can modify the "references" on the visualization to point to a different index pattern:

```auto
{"id":"ff959d40-b880-11e8-a6d9-e546fe2bba5f","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}

```

That's what my reference looks like on a sample visualization. If you change the "id" to whatever index pattern you want, you should effectively switch the index pattern associated with the visualization. But you may also break things. So, it's not recommended.

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 2, 2019, 9:00pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578/3 "2019-07-02T21:00:56Z")

</div>

@christophilus, thanks for your clarification, I hope your team can release this feature asap because it makes the user's life much easier, but in the meantime that we are stuck with this older approach, I was wondering how do you know what id is associated with what index name?

Here are is my reference.

references:

```
[
  {
    "name": "kibanaSavedObjectMeta.searchSourceJSON.index",
    "type": "index-pattern",
    "id": "906f3b00-99e5-11e9-a677-f58a6457b295"
  },
  {
    "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[0].meta.index",
    "type": "index-pattern",
    "id": "906f3b00-99e5-11e9-a677-f58a6457b295"
  },
  {
    "name": "kibanaSavedObjectMeta.searchSourceJSON.filter[1].meta.index",
    "type": "index-pattern",
    "id": "906f3b00-99e5-11e9-a677-f58a6457b295"
  }
]
```

---

<div class="post-metadata">

**Author:** ![EZprogramming](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ezprogramming/32/57291_2.png) [@EZprogramming](https://discuss.elastic.co/u/EZprogramming)\
**Post date:** [July 2, 2019, 11:09pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578/4 "2019-07-02T23:09:17Z")

</div>

Found it, you can go to

Kibana \> management \> saved objects (filter index patterns) \> export (you will see the \_id of your index pattern in export.json file).

You can also do the same process and export the json files for each visualization and dashboard, change the name and ids of under references, and import the saved json file back to kibana. It will most likely replace the original visualizations because the visualizations share the same id. To have two different visualizations we have to have unique ids.

---

<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:** [July 30, 2019, 11:09pm UTC](https://discuss.elastic.co/t/change-visualization-index-under-saved-objects/188578/5 "2019-07-30T23:09:23Z")

</div>

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