Fun with logging — Part 2: Kibana

Now let’s have some fun with code! In this part I’m using Python3 to automate the creation of our saved searches, visualizations and dashboards.

tl;dr: here’s the code to make this happen:

I’m intentionally leaving in debugging code here ( warts and all! ) in case someone needs to learn with me. It’s important to me that people see that this was a work in progress.

Here’s the workflow for what goes on here:

  • Create the search saved_objects. Saved objects are things used by Kibana in dashboards and search results.
  • Create a different type of saved_object called a visualization. This is how TimeLion visualizations are stored.
  • Create two dashboards: Logs and Telemetry

The logs dashboard is a very simple dump of every service log, which can end up being a large page view. But it’s very handy for seeing all of the logs separated by services.

The Telemetry dashboard uses the TimeLion expressions detailed in the previous post to create 3 views which help us understand the timing and data flow through a given environment broken down per vehicle.