你如何 export/import "index-pattern" 在 Kibana 中打字

How do you export/import "index-pattern" types in Kibana

Kibana 4.3 在 importing/exporting 仪表板、搜索和可视化方面具有强大的功能。但是,相关的索引模式不包含在生成的 export.json 文件中。将 export.json 文件导入另一个 kibana 索引时,Kibana 报错 Could not locate that index-pattern-field (id: <index-pattern name>).

如何将 kibana 的索引模式从一个 Elasticsearch 实例迁移到另一个实例?

谢谢,

弥敦道

来自official documentation(强调已添加)

Exported dashboards do not include their associated index patterns. Re-create the index patterns manually before importing saved dashboards to a Kibana instance running on another Elasticsearch cluster.

由于索引模式与其他任何东西一样保存在 .kibana 索引中,您可以做的是使用临时工具保存它们,而不是必须手动重新创建它们,例如(例如) elasticdump,像这样:

elasticdump \
  --input=http://host1:9200/.kibana \
  --input-index=.kibana/index-pattern \
  --output=http://host2:9200/.kibana \
  --output-index=.kibana/index-pattern \
  --type=data

您还可以在 .kibana 索引上使用 snapshot/restore

对于任何试图将 AWS elasticsearch 实例从一个集群迁移到新集群的人...(希望这有帮助...)

我遇到了与 OP 类似的问题(我试图使用 AWS instructions 将数据从一个 AWS Elasticsearch 实例迁移到一个新实例)。 出于某种原因,群集的恢复将失败并出现以下神秘错误。

"cannot restore index [.kibana] because it's open" 

经过多次谷歌搜索和摸不着头脑后,我决定将 .kibana 索引单独迁移到其他索引会更容易

我尝试了@Val 的绝妙建议来使用 elasticdump ,但是,@Val 的示例对我不起作用。

我最终将我的命令基于 elasticdump 自述文件中的示例,

  elasticdump \
  --input=https://search-some-prod-instance.ap-southeast-2.es.amazonaws.com/.kibana \
  --output=https://search-other-prod-instance.ap-southeast-2.es.amazonaws.com/.kibana \
  --type=data

执行 运行 此命令后,我旧 kibana 中的索引现在可在新 kibana 中使用。 (最后:p)

nb:我还使用了 kibana "management->saved objects export / import" 来迁移我的可视化、搜索、仪表板等...