Wants to generate Visualization and Dashboard

HI there,

I have 200 indices with the same type and wants to build same visualizations and dashboards for them, is there any way to create by scripts all together at once rather than creating one by one from Visualization tab in kibana.

I'm using Kibana 6.0.


Are you trying to display all indices in the same dashboard or visualization? Or are you trying to make the same visualization/dashboard for each index?

I'm trying to create same visualization/dashboard for each index separately.

Do the indices share a prefix? What you can do is create a visualization using a shared prefix (or if not, just *). For instance if your indices are animal-cat, animal-dog, animal-pig, and they all have the same mappings, you can create a visualization using the index pattern animal-*.

That will at least alleviate the need to create the same visualization 200 times. You'd still have to create 200 dashboards (though if we implemented https://github.com/elastic/kibana/issues/16919 you would only need to manage one of those 200 dashboards for all changes to propagate).

Currently though, what you can do is create a dashboard for each index pattern, and use filters to segment the data you wish to see. You can either use a field you might have available in the indexes (e.g. in my example above you might have a field called animalType). If you don't though, you can still filter on the index pattern by creating a painless field on animal-* to extract the index substring. Something like

return doc['_index'].value.substring(0, 10)

Let me know if that helps!

I'll try this and let you know if I need any help....

Hi Stacey,
If I create with Prefix, that creates only one visualization of the grand total from all 200 indices, but I want it should generate individual visualizations for each of them.

Will the 200 visualizations be duplicates of each other in every other aspect, aside from the index pattern?

I created one Index pattern with Prefix and then created a visualization for that prefix, the visualization gave me a total number of messages from all the 200 indices, but I want visualization for each of them separately. Generally, we create index pattern 1st then create visualization for it, if I do like this I have to 200 times but this is not prefered method to do if we have like that lot of indices, so the reason I'm looking for some solution where we can create similar kind of visualization at once for all of them.

You just need to add the filter while you are looking at the visualization to segment to whichever data you want.

You don't even need a scripted field, you can enter it manually:

The benefit of doing it this way is if you ever want to change one of the visualizations, you don't have to do it 200xs, you only do it once and all your dashboards with that visualization on it are updated.

If you really want different objects for each index, we don't have a script to do that automatically for you. You could use the export/import with a bunch of copy/paste/edit index pattern. It'd be manually intensive though.

Thanks, Stacey, this will work for me and helps me with changes in Viz.


I tried and working good, thanks for it ...

Have one more question on the same page- When we filter dashboard with index. I can see only 10 indices in the drop-down option. Is there any way to get all indices in the filter list what we have in the prefix list, so that we can select from a list of indices and check dashboard.

I appreciate your help... Thanks-Manu

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.