# How can I overwrite default index pattern name while importing dashboards for beats

**URL:** <https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857>\
**Category:** Beats\
**Created:** [May 16, 2017, 6:05am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857 "2017-05-16T06:05:58Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 16, 2017, 6:05am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/1 "2017-05-16T06:05:58Z")

</div>

I've installed Filebeat and Metricbeat via YUM repo. And everything runs ok.

now, I have a problem to overwrite default index pattern name. no matter I use **_./script/import\_dashboards -i_**  
or **_dashboards.index: customize-metric-\*_** in XXXbeat.yml. it's always import the default pattern name like **_metricbeat-\*_**

anybody else can help me out? than you very much

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [May 16, 2017, 9:25am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/2 "2017-05-16T09:25:24Z")

</div>

Hi @zaqweb,

Could you share info about your setup (beats & elasticsearch version) + some logs of what you get when you run those commands?

Best regards

---

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 16, 2017, 10:00am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/3 "2017-05-16T10:00:44Z")

</div>

hey exekias, I'm using latest version 5.4.0

I removed all index patterns in kibana, then I try to run below command

$ ./scripts/import\_dashboards -es [http://10.0.96.162:9200](http://10.0.96.162:9200) -i portal-metric-\* -file /app/elastic/beats-dashboards-5.4.0.zip  
Create temporary directory /tmp/tmp082238117  
Unzip archive /tmp/tmp082238117  
Importing Kibana from /tmp/tmp082238117/beats-dashboards-5.4.0/filebeat  
Importing Kibana from /tmp/tmp082238117/beats-dashboards-5.4.0/heartbeat  
Importing Kibana from /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat  
Import directory /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/index-pattern  
Change index in index-pattern metricbeat-\*  
Import index to /.kibana/index-pattern/metricbeat-\* from /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/index-pattern/metricbeat.json

Import directory /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/dashboard  
Import dashboard /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/dashboard/66881e90-0006-11e7-bf7f-c9acc3d3e306.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/e784dc50-0005-11e7-bf7f-c9acc3d3e306.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/67e88e60-0005-11e7-aaf1-b342e4b94bb0.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/0f506420-0006-11e7-bf7f-c9acc3d3e306.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/67e88e60-0005-11e7-aaf1-b342e4b94bb0.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/1a99f2b0-0006-11e7-bf7f-c9acc3d3e306.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/67e88e60-0005-11e7-aaf1-b342e4b94bb0.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/45a00c10-0006-11e7-bf7f-c9acc3d3e306.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/67e88e60-0005-11e7-aaf1-b342e4b94bb0.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/1eda2280-0008-11e7-82f3-2f380154876c.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/1ede99e0-0009-11e7-8cd4-73b67e9e3f3c.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/4c36c420-000a-11e7-8cd4-73b67e9e3f3c.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/a2175300-000a-11e7-b001-85aac4878445.json  
Import dashboard /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/dashboard/CPU-slash-Memory-per-container.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Container-CPU-usage.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/System-Navigation.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Container-Memory-stats.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Container-Block-IO.json  
Import dashboard /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/dashboard/Metricbeat-Apache-HTTPD-server-status.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-CPU.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Hostname-list.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Load1-slash-5-slash-15.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Scoreboard.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Total-accesses-and-kbytes.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Uptime.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Apache-HTTPD-Workers.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Apache-HTTPD.json  
Import dashboard /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/dashboard/Metricbeat-Docker.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-containers.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Metricbeat-Docker.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-Number-of-Containers.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Metricbeat-Docker.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-containers-per-host.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Metricbeat-Docker.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-images-and-names.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Metricbeat-Docker.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-CPU-usage.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-memory-usage.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/Docker-Network-IO.json

.....  
.....  
.....  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/System-stats.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/System-load.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Load-stats.json  
Import visualization /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/visualization/CPU-Usage.json  
Import search /tmp/tmp082238117/beats-dashboards-5.4.0/metricbeat/search/Cpu-stats.json  
Importing Kibana from /tmp/tmp082238117/beats-dashboards-5.4.0/packetbeat  
Importing Kibana from /tmp/tmp082238117/beats-dashboards-5.4.0/winlogbeat

I removed some importing msg in the middle

I'm using **_-i portal-metric-\*_** wanna try to overwrite default index pattern name **_metricbeat-\*_**

but it's not take effect, the default pattern was still imported

---

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 16, 2017, 3:16pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/4 "2017-05-16T15:16:16Z")

</div>

I think my problem is same as [Import Dashboards on non standard indexes](https://discuss.elastic.co/t/import-dashboards-on-non-standard-indexes/81712?u=zaqweb)

---

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [May 16, 2017, 3:51pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/5 "2017-05-16T15:51:33Z")

</div>

Having the exact same issue. Using the `-i` is actually not doing anything and the index pattern is still created as `metricbeat-*`

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [May 17, 2017, 12:29pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/6 "2017-05-17T12:29:35Z")

</div>

You can not change the index pattern in the dashboards by the importer, as these are pure json documents to be index in the `.kibana` index. You have to adapt the dashboards: download, unpack and update the dashboards documents (e.g. use `sed` to update all ocurences of `metricbeat-*`to `portal-metric-*`). Install updated dashboards using ./scripts/import\_dashboards.

Already installed dashboards/searches can be update from within Kibana in `Managed Objects`.

---

<div class="post-metadata">

**Author:** ![Mormaii](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mormaii/32/10790_2.png) [@Mormaii](https://discuss.elastic.co/u/Mormaii)\
**Post date:** [May 17, 2017, 1:06pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/7 "2017-05-17T13:06:22Z")

</div>

So why does the importar have the `-i` flag which is supposed to do exactly that?

---

<div class="post-metadata">

**Author:** ![steffens](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/steffens/32/79630_2.png) [@steffens](https://discuss.elastic.co/u/steffens)\
**Post date:** [May 17, 2017, 11:27pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/8 "2017-05-17T23:27:17Z")

</div>

Oh, wasn't aware of `-i`. The import is [implemented here](https://github.com/elastic/beats/blob/5.4/libbeat/dashboards/dashboards/importer.go). Searching for `cfg.Index`, I see search objects and index mapping being update by the script, but then the updated index pattern is still stored in `metricbeat-*`. See this line: [https://github.com/elastic/beats/blob/5.4/libbeat/dashboards/dashboards/importer.go#L306](https://github.com/elastic/beats/blob/5.4/libbeat/dashboards/dashboards/importer.go#L306)

Same happens in master.

Looks like a bug to me, but I'm not too familiar with the workarounds import\_dashboards does apply. Can you open [a bug report](https://github.com/elastic/beats/issues)?

---

<div class="post-metadata">

**Author:** ![zaqweb](https://avatars.discourse-cdn.com/v4/letter/z/898d66/32.png) [@zaqweb](https://discuss.elastic.co/u/zaqweb)\
**Post date:** [May 23, 2017, 1:16am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/9 "2017-05-23T01:16:28Z")

</div>

I'm going to close this question and have submitted a bug here [https://github.com/elastic/beats/issues/4345](https://github.com/elastic/beats/issues/4345)

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [May 23, 2017, 1:43pm UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/10 "2017-05-23T13:43:23Z")

</div>

@zaqweb Thanks

---

<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:** [June 6, 2017, 6:18am UTC](https://discuss.elastic.co/t/how-can-i-overwrite-default-index-pattern-name-while-importing-dashboards-for-beats/85857/11 "2017-06-06T06:18:48Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
