Skip to content

Kibana

Automatic creation of Kibana saved objects

It is possible to create any Kibana object (if it can be exported as a saved object) when Kibana first starts.. This is useful for creating for example index patterns, dashboards or saved queries that will be available the first time Kibana runs. The objects will be created by using Kibana's Import objects API

To create these objects when Kibana starts, you need to first export from Kibana the objects you'd like imported. For version 7.13, you can do this from the management page, http://:/app/management, more specifically, http://:/app/management/kibana/objects. In that page, select the object(s) you want and export them. You will end up with a .ndjson file.

Then, go to the dotnet/docker/kibana-first-time-config folder. The files in that folder start with a number, and will be imported in sequence. Follow the naming pattern so your file will be imported last. For example, if you add a "02 - my exported objects.ndjson" file, you should end up with a structure like this:

Text Only
1
2
3
4
5
dotnet
└───docker
    └───kibana-first-time-config
        |   01 - default-index-pattern-and-dashboards.ndjson
        |   02 - my exported objects.ndjson

To import the objects immediately, inside the dotnet directory execute this command:

./compose.sh up --build kibana

To verify that the objects have been imported, execute this command: docker logs kibana-first-time-config

You should see output similar to this:

Text Only
{"successCount":7,"success":true, //[..] }

This would be the json output when trying to create objects that already exist:

Text Only
{"successCount":0,"success":false, //[..] }