# $kibana

This keyword creates a bar chart from the values given as data sources to it.

# Installation:

cob-cli customize kibana

# Usage:

$kibana(kibana_space,dashboard_id,search_query,dashboard_height)

To work as expected, the $kibana keyword requires four parameters:

Parameter Description
kibana_space The name of the kibana space in your CoB server. Please be aware that the default space is not supported in the sense that the name of the space must be specific.
dashboard_id The id of the kibana dashboard you want to embed on RecordM.
search_query query containing a key and a value placed inside mustaches - {{ and }}. The value is a placeholder for the value of another field. In our example, the value refers to the Short Name field of the same definition.
dashboard_height The height in pixels that you want the bar chart. The default value is 300.

To know more about kibana, read this brief introduction. There you will find resources on how to create a kibana dashboard and embedded into the home page of your CoB server or even on all instances of a given definition.

To obtain the id of your newly created dashboard:

  1. Access the URL name_of_your_server.cultofbits.com/kibana and then select the space where you have created the dashboard you want to embed:
  1. After accessing the desired space, click on the hamburger navigation menu located on the left side of your Space page.
  1. Next, click on the Dashboard link within the Analytics menu:
  1. After that, click on the dashboard you want to embed on your CoB server:
  1. To obtain the id, click on the Share button located on the top right corner. and then on the Permalinks option:
  1. Select the Saved object option and then click on the Copy link button.
  1. Paste the link on any text editor and copy the alphanumeric section of the link containing dashes in the middle. For instance, in our case this will be the de075bc0-7c9c-11ed-a18d-f748ebe4a0ad part of the following URL:
https://learning.cultofbits.com/kibana/s/countries-demo/app/dashboards#/view/de075bc0-7c9c-11ed-a18d-f748ebe4a0ad?_g=(filters%3A!())

# Examples:

# 1. With the $group keyword:

$group $kibana(countries-demo,de075bc0-7c9c-11ed-a18d-f748ebe4a0ad,country_name:{{Short Name}},400) 

The $kibana keyword is most often used simultaneously with the $group keyword. The final result will be a kibana bar chart displayed right below the $group separator. The bar chart will only show data concerning the value given to the field used in the query.

In the image below, you can see how the GDP: linked series (current LCU) field is built within the Countries definition: