# Changing the index pattern that a visualisation is based on

**URL:** <https://discuss.elastic.co/t/changing-the-index-pattern-that-a-visualisation-is-based-on/268290>\
**Category:** Kibana\
**Created:** [March 25, 2021, 5:35am UTC](https://discuss.elastic.co/t/changing-the-index-pattern-that-a-visualisation-is-based-on/268290 "2021-03-25T05:35:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [March 25, 2021, 8:19am UTC](https://discuss.elastic.co/t/changing-the-index-pattern-that-a-visualisation-is-based-on/268290/2 "2021-03-25T08:19:50Z")

</div>

Editing the ndjson file is certainly an option. Each visualization has a "references" section - if you already have the index pattern saved object in your Kibana instance, you can simply fill in your id there:

```auto
"references":[{"id":"90943e30-9a47-11e8-b64d-95841ca0b247","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}]

```

replace by

```auto
"references":[{"id":"the-id-of-your-local-index-pattern","name":"kibanaSavedObjectMeta.searchSourceJSON.index","type":"index-pattern"}]

```

I also explained some approaches here which work from within the Kibana UI: [Rename the index-pattern for sample visualizations - #2 by flash1293](https://discuss.elastic.co/t/rename-the-index-pattern-for-sample-visualizations/266617/2)

Lens visualizations allow you to change the index pattern simply by editing them and changing it in the dropdown.

---

_[View the full topic](https://discuss.elastic.co/t/changing-the-index-pattern-that-a-visualisation-is-based-on/268290)._
