Skip to content

Logging (Kibana)

Barrett Falk edited this page Jul 10, 2024 · 13 revisions

Introduction

If you already have created an index in Kibana, here's the URL to view logs: Kibana Logging

Logs can be queried via Kibana (using the link above). Kibana is an open-source data visualization and exploration tool developed by Elastic. It is designed to work in conjunction with Elasticsearch, a distributed search and analytics engine, to provide a user-friendly interface for analyzing and visualizing data stored in Elasticsearch.

The first time you use Kibana, you'll be asked to create an index (see below). Kibana scrapes the consoles from the OpenShift containers, so you'll need to login to Kibana using the same account that has access to the OpenShift containers.

Setting up Kibana

  1. Create an index (e.g. app-*), then click "Next step"
image
  1. Select a Time filter field name (@timestamp) and click "Create index pattern"
image
  1. Click "Discover" (see blue arrow in below screenshot) to begin your search. By default, any output from a console log will be captured here, in any of your applications associated with your idir. You can narrow down the results using the search field (green arrow in below screenshot). For example, you can filter logs by pod name or even by text (e.g. typing "backend" will return all the logs that contain the text "backend").

Note: Ensure that the time period is set correctly, by default only the last 15 minutes of logs are displayed (see orange arrow in below screenshot).

image

Alternate Methods of Viewing Logs

Logs can be viewed for specific pods in specific OpenShift namespaces. To do so:

  1. Select the pod of your choice (https://console.apps.silver.devops.gov.bc.ca/k8s/ns/c1c7ed-test/core~v1~Pod)
  2. Click the "Logs" tab, and then click "Show in Kibana"

image

Helpful Filters

There doesn't appear to be a way to save filters; however, we can save a bookmark that contains the filter logic. The Kibana link provided above contains several filters (e.g. dev, test, prod namespaces to restrict logging to those environments)