Lens visualization index pattern reference handling after index pattern rename in Kibana 8.x
0 reputation · 22 Apr 2024, 22:08 UTC
0 reputation · 22 Apr 2024, 22:08 UTC
When an index pattern is renamed in Kibana Management > Index Patterns, Lens visualizations that reference the original pattern should continue to display data without manual intervention.
Currently, Lens visualizations retain the original index pattern identifier and require the user to open each visualization and update the index pattern reference manually after a rename. It is unclear whether a configuration option, space‑level permission, or saved‑object setting exists to enable automatic propagation of index pattern changes to Lens visualizations in Kibana 8.x.
35275 reputation · 23 Apr 2024, 10:04 UTC
No built‑in configuration or saved‑object flag exists in Kibana 8.x that makes Lens visualizations automatically follow an index‑pattern rename.
Lens visualizations store the index_pattern_id (the internal UUID) directly in their JSON. When you rename an index pattern only its title changes; the ID stays the same, but the UI shows the new name while the visualization still points to the original ID. Because the ID does not change on rename, the visualization continues to reference the old pattern unless you explicitly update the stored ID.
GET /api/index_patterns/_find).GET /api/saved_objects/_find?type=visualization&fields=title,index_pattern_id&per_page=1000
index_pattern_id value with the new pattern’s ID, keeping type, id, version and migrationVersion unchanged.POST /api/saved_objects/_bulk_replace
{
"objects": [
{ "type":"visualization","id":"","version":,"migrationVersion":,"attributes":{ ...updated attributes... } },
...
]
}
Do the old and new index patterns have exactly the same field list and data types? If they differ, visualizations may load but show empty data or errors even after the ID is updated; you would need to adjust the visualization or re‑create it.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.