DevOpsBootcampUPES

Elasticsearch and Kibana

Let’s get yourself familiar with the ELK stack:

https://www.elastic.co/what-is/elk-stack

Working with Kibana

Visit Kibana by port-forwarding the service:

kubectl port-forward svc/<kibana-service> 5601:5601

Then go to https://localhost:5601.

Open the Spaces tooltip, and create your own namespace in which you will practice:

Add the sample data

Sample data sets come with sample visualizations, dashboards, and more to help you explore before you ingest or add your own data.

  1. Open the kibana server
  2. On the home page, click Try sample data.
  3. Click Other sample data sets.
  4. On the Sample web logs card, click Add data.

Kibana Query Language (KQL)

Before we are experimenting with KQL, read the following important concepts of Kibana.

Then, read the KQL short tutorial from Elastic’s official docs.

Try it yourself

Open the Kibana Sample Data Logs data view under Discover page, and search for the following information:

Filters

Kibana Dashboards

Try it yourself - create a new dashboard

Panel I: Unique visitors

In the layer pane, Unique count of clientip appears because the editor automatically applies the Unique count function to the clientip field (Unique count is the only numeric function that works with IP addresses).

Panel II: Outbound traffic over time

To visualize the bytes field over time:

The visualization editor creates a bar chart with the timestamp and Median of bytes fields.

Panel III: Top requested pages

We will create a visualization that displays the most frequent values of request.keyword on your website, ranked by the unique visitors.

The visualization editor automatically applies the Unique count function.

Note: The chart labels are unable to display because the request.keyword field contains long text fields

Panel IV: Classify request size

Create a proportional visualization that helps you determine if your users transfer more bytes from requests under 10KB versus over 10Kb.

To display the values as a percentage of the sum of all values, use the Pie chart.

Panel V: Distribution of requests along the day

Create the following visualization:

Panel VII: Website traffic sources

Create a filter for each website traffic source:

Panel VI: SLA (Service-level agreement)

Assume Facebook and Twitter are your two major customers, and your company agreed to serve 99% of the incoming requests originating from Facebook or Twitter.

Create a visualization which calculates the SLA per client over a single day. The SLA is defined by the following formula:

1 - [(# of failed requests)/(# of total requests)]

Failed requests are those with status code >= 500.

Tip - use thew following custom formula:

1 - (count(kql='response.keyword >= 500') / count(kql='response.keyword: *'))