当前位置:网站首页>How to restore visualizations and dashboards after kibana rebuilds the index

How to restore visualizations and dashboards after kibana rebuilds the index

2022-06-23 08:28:00 Handyman

background

Because adjustment index, The reconstruction Index patterns{ Name the same } After that Visualizations and Dashboards And other views cannot be opened normally , Tips Could not locate that index-pattern (id: xxxxxx), click here to re-create it This is because index id Has been changed .

The reconstruction Index patterns How to keep ID Agreement , The view is not affected .

Before deleting , Record the old index pattern Of ID, Then create a new index pattern Use old index pattern Of ID

How to get index pattern Of ID

Method 1 Use dev tools

GET .kibana/_search
{
    
  "query": {
    
    "match": {
    
      "index-pattern.title": "logs_template-*"  #index name 
    }
  }
}
 Output :
 "hits" : [
      {
    
        "_index" : ".kibana_1",
        "_type" : "_doc",
        "_id" : "index-pattern:09176830-f11c-11ec-853a-6f964690836d",
        ····

Method 2 see url

Kibana > Management > Index patterns > logs_template-* # edit index patterns
At this time, the browser's url:***/app/kibana#/management/kibana/index_patterns/09176830-f11c-11ec-853a-6f964690836d?_g=

How to use old index pattern Of ID

Kibana >Management > Index patterns > Create index pattern
Creating a new index patterns when The second step 【Show advanced options】
custome index pattern id fill id

This will protect Dashboards Not destroyed .

The reconstruction Index patterns ID change , How to restore the view .

The first thing to understand is Discover、Visualizations、Dashboards Saved search All in :
Kibana >Management > Saved objects
therefore We just need to restore the relevant Saved Objects That's all right.

Method 1 # For lower versions references There is ID

Kibana >Management > Saved objects > Corresponding index pattern > inspect

[
  {
    
    "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"
  }
]

take id Change to a new one index pattern Of ID Save it

Method 2 references There is no ID

Kibana >Management > Saved objects > Select corresponding index pattern > export

  • Edit export export.ndjson file
  • Find and replace ID
  • Use Saved objects Of import function , Select overlay

Method 1 is simple and convenient , Method 2 Import and export are required , But it can be modified in batch

Refer to the

ELK How to update Kibana Visualization & Dashboard Corresponding Index Pattern

Change visualization index under saved objects

Delete and re-create an index pattern

原网站

版权声明
本文为[Handyman]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/174/202206230801381892.html