Our step-by-step guide to create a timelion expression in Kibana.
Learn how we at reelyActive create these visualizations to help you to visualize and analyze your space occupancy.
reelyActive open source software with Elasticsearch and Kibana.
In order for there to be data to visualise, the reelyActive software must also have collected and written raddec data to Elasticsearch.
Create and visualize a timelion on Kibana.
Open Kibana and then:
The default settings will result in an empty timelion expression .es(*)
which leads to a null value on the y-axis, similar to that below. The next step will be to define a meaningful timelion expression to visualize data.
Create timelion expressions to visualize data properly.
.es
(or .elasticsearch
) function which gathers data from Elasticsearch and draws it over time.Each Timelion expression begins with a dot, followed by es
and surrounded by parentheses which contain parameters.
To visualize the number of unique devices, you are going to define an index, timefield and metric.
Settings | What's for? | Parametters |
---|---|---|
Index | Index to query. Provide Index Pattern name for scripted fields and field name type ahead suggestion for metrics, split and timefield arguments. | raddec |
Timefield | Field of type "date" to use for x-axis. | timestamp |
Metric | An elasticsearch metric agg:avg, sum, min, max, percentiles or cardinality, followed by a field. | cardinality:transmitterId.keyword |
By assembling all these settings and parameters you should get the following expression:
.es(index=raddec,timefield=timestamp,metric=cardinality:transmitterId.keyword)
The Timelion should now feature a curve providing a visualisation of relative number of unique device, similar to that below. In the next step we are going to split the Timelion expression to visualise the number of unique device per receiver.
Split the timelion function to visualize different series.
So far we've displayed the cardinality of unique devices for all sensors. To gain precision and analysis we are going to visualise the number of unique device per receiver using split parameter.
Setting | What's for? | Parametter |
---|---|---|
Split | An elasticsearch field for split the series on and a limit. | receiverId.keyword:3 |
By adding the split parameter to the exisiting .es()
function you should have the following expression :
.es(index=raddec,timefield=timestamp,metric=cardinality:transmitterId.keyword,split=receiverId.keyword:3)
The resulting visualization should look like the one below :
Customize and Personalize the visualization.
Several parameter can be modified or added. In this visualization, a relevant improvement would be to change the labels of each serie.
Settings | What's for? |
---|---|
Label | Legend value for series. You can us $1, $2, etc, in the string to match up with the regex capture groups. |
Regex | A regex with capture groupe support. |
To label different lines on split operation you can add to the existing .es()
function the function below :
.label("Receiver Id: $1", "^.* > receiverId.keyword:(.+) > .*")
The $1 will be replaced by the first argument in the regex, receiverId.keyword:(.+) so you should end up your key labels as:
Receiver Id: identification1
Receiver Id: identification2
Receiver Id: identification3
This visualization can be combined with other visualizations as part of a space occupancy dashboard, such as that below.
For our innovation of making physical spaces searchable like the web.
Create other visualizations, or continue exploring our open architecture and all its applications.