How to create a Logging Dashboard with Kibana
Tags: kibana, elasticsearch, monitoring, microservices
Published: 2020-08-09 07:30:56

---
title: How to create a Logging Dashboard with Kibana
published: true
description: A tutorial on creating your first Kibana dashboard
tags: kibana, elasticsearch, monitoring, microservices
series: Integrating your Go service with ELK
cover_image: https://i1.wp.com/pmihaylov.com/wp-content/uploads/2020/08/kibana-dashboard.png?w=1352
canonical_url: https://pmihaylov.com/kibana-dashboard-tutorial/
---
<!-- wp:paragraph -->
<p>In this tutorial, I'll show you how to create a dashboard for your application's structured logs in Kibana.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This is a follow-up to <a href="https://pmihaylov.com/go-structured-logs/">this article</a>, which covers how to instrument your Go application \w structured logging for use by Kibana (in this tutorial).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We'll use Kibana v7.6 but any version you're using should work. It's just that your UI might look a bit different &amp; you'll have to adjust.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Let's jump straight in! We'll stick to simple panels, which suite most of the use-cases you'd need.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Starting Point</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>First, make sure you have <strong>docker</strong> and <strong>docker-compose</strong> installed.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For <strong>docker</strong>, follow the installation instructions for your platform <a href="https://docs.docker.com/get-docker/">here</a>.<br>For <strong>docker-compose</strong>, follow the installation instructions <a href="https://docs.docker.com/compose/install/">here</a>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Afterwards, download this exercise’s repository on the <strong>kibana-dashboard-tutorial</strong> branch:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>git clone --branch kibana-dashboard-tutorial https://github.com/preslavmihaylov/tutorials</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>What you already have is a Go application, which randomly produces logs for endpoints <strong>/payments/execute</strong>, <strong>/payments/list</strong>, <strong>/payments/authhold</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Starting from here, you will build a dashboard for effectively monitoring &amp; analysing incoming traffic.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the following section, I will walk you through how to achieve this step by step.</p>
<!-- /wp:paragraph -->

<!-- wp:heading -->
<h2>The Walkthrough</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3>Boot up all containers</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Invoke this command to bring up all containers:</p>
<!-- /wp:paragraph -->

<!-- wp:code -->
<pre class="wp-block-code"><code>docker-compose up</code></pre>
<!-- /wp:code -->

<!-- wp:paragraph -->
<p>For all following steps, make sure you never execute docker-compose down.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>That command will not only stop all containers but delete them as well.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you're seeing some issues with booting up elasticsearch, here is a reference to some common issues &amp; how to handle them:</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><a href="https://github.com/laradock/laradock/issues/1699">elasticsearch exit code 78</a><br><a href="https://github.com/10up/wp-local-docker/issues/6">elasticsearch exit code 137</a></p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Setup your application’s baseline saved search</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Go to <a href="http://localhost:5601/app/kibana#/home">http://localhost:5601/app/kibana#/home</a> and open the <strong>Discover</strong> tab.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>First, expand the tab names in the bottom-left as they are unfamiliar at first:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":285,"height":152} -->
<figure class="wp-block-image is-resized"><img src="https://lh4.googleusercontent.com/sOpKgG_GBDIzy2fvbObbUz1ae3FYa9UsWSBaTtgJ1dQm_ZErpGHm2p8KMj1Ut8VxZhZbAl_4WMmGVhnNar-jH-kZyNCnjNzm4KOXQszVxWpTl0fbe3WTbaVBuG1vKjHM9WCVgoH1" alt="the expand button" width="285" height="152"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Then, find the <strong>Discover</strong> tab in the top-left:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":382,"height":221} -->
<figure class="wp-block-image is-resized"><img src="https://lh6.googleusercontent.com/0_OX3LO3-oLo6AT7SV2C3KZR6KFxHmC-ZO2Nzss_jD0MnKQw4XT1tB-wNvHJ0kDhldMfji6aGEtOY6MfuzRfzopNkL8XSmBuUYFZmg5lklWMDGIkxezE_jlh74CYw9RhZ8TnX-dX" alt="Click discover in the Kibana dashboard" width="382" height="221"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Set the index pattern if you haven’t already:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh6.googleusercontent.com/PigYRco-kctctYwF_Pm_WvojuunJ2WgexEEPr-noiquQ1AWE9DI-TGKVJQy0N8vox8bV8uOY1pvkU4oR8yLDvbzCKeqGSNDVtxgGwRGZ-ju1SqSnrinpAZvyoIwk4WmZvc0XAVfg" alt="Create index pattern"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>On the next step, choose <strong>@timestamp</strong> as a time filter:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/vqREV-Zx7s7Q3oT_iPwm4gnQ7lEPt31dncYn6JDymQsgOLR8xMRgt5PuO1FuMMZhy7zKH-PB-6UL_tTf71umcRAJmjudTPOsXujY4DxKiiIOztZMWSc63sUA3wAq4x9YQ77LbM7k" alt="Configure index pattern settings"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Open the <strong>Discover</strong> tab again. This is what the initial view should look like:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/2MMlqalb-uNDR-QrvALEq3F4uYNQsKDvMCK27JW5MuwOHTNWTKD-mGPmCxAb_73DBh7rPznvJZhBvUqcu_jw9sfcuAmvjRHVlkA87HPZfRXcBQhQcwnAo6AYXKjAmH6Qcug_BUQ6" alt="The discover tab"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Currently, kibana shows all log lines from our application without any filtered fields. We can exclude all fields we don’t need:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":569,"height":224} -->
<figure class="wp-block-image is-resized"><img src="https://lh5.googleusercontent.com/Wb6ozBL95IghC5tObSqx09919GqDMrm6ecN0cvy4qj7i8vpp-MZv0z1qGpBFwVE9GQhI3jRKNPovPQa805muoW7CpPotC38vf7vNzb3bX_X3_F_BVra1Z_OIdXgrjBKRllrTqhv6" alt="Exclude unneeded fields" width="569" height="224"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Next, select only the fields which make sense for our application.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Those are <strong>endpoint, method, countryISO2, userID, paymentMethod, userType, error, msg</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For each of them, click Add to add them to the selected fields in the visualised log:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":366,"height":532} -->
<figure class="wp-block-image is-resized"><img src="https://lh4.googleusercontent.com/84_InyZ2LisDaJ9IMMeBm7z8p2A9tft4emi8HZHH4B1yUtCCrSjRqwtGXtuGk2sYxXHcZocCR-akkz5a4wK0tS_-Ti8CG3TI6crkPO_tLCutu0OIapeOlrRSHns8dLmFW0eqAJ3q" alt="Filtering the fields you need" width="366" height="532"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In the end, this is what your <strong>Selected fields</strong> should be:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":318,"height":312} -->
<figure class="wp-block-image is-resized"><img src="https://lh6.googleusercontent.com/L78RkT2keQToPjkGI7qvtsyjD_i8-iHeSnh-UuBr2BsGkHcj3eL_SlHONYS_w5sCLsZjYwDrVSH6MbdlWkwHcahyHwPb0Tgldn6vb4hShrZNynhdqdMv4Gb5Fc68TX5yeC35hzCU" alt="The final selected fields" width="318" height="312"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>If you did these steps properly, this is an example of what your logs should look like:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/qOgyrN0CfQqK1RCXsidLgywYZsE3NC2SaH-B0Zv0OG_KuuuOKkG1Sbpi5xxM0-Ds1NN0rc0uxos56RY30PR61VZeKAKu29ON2Dj80o93oeTuvOZyrE4jj-GpuNvgcvlh8xUvZILH" alt="Discover tab after filtering"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>We will use this saved search as a baseline view for our dashboard.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Click <strong>Save</strong> at the top-left to later reuse this view for our dashboard:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":448,"height":271} -->
<figure class="wp-block-image is-resized"><img src="https://lh6.googleusercontent.com/gfsRAEnWZKcq2yW2xCVd2cd5ynVcTkvQM4xlwYfr-mGRvvrnv0cuHp8eOQcT6uE7C2-XuFIl0ZqHjvQGQvyc-qRDXJCOmhYuBI-Go9SYB8YRwofUigOjJOMMmLn6ei0qMWvgbF8M" alt="Saving your current view" width="448" height="271"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This is one of the most useful views as it allows one to inspect the details of the events which happen in your application.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Setting up your initial Kibana dashboard</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Open the <strong>Dashboard</strong> tab to create your first dashboard:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":343,"height":318} -->
<figure class="wp-block-image is-resized"><img src="https://lh5.googleusercontent.com/CZhCxyjk6NLXRnHFoZwUatYfdZ4BYYB3JF1PY_Ws9rSC0SlwavrsgTn8wbCv-t0Xs6LsPLJ_2YR9VHKC2k0HYPKHSv26KggKOzoYvXXwlJfM3zNmSuT0qsG_fbfzt2CTYvUI6DUa" alt="Your initial Kibana dashboard" width="343" height="318"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Follow the instructions on-screen:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/UBxo4umfb5ZQJLrh-GeZOL37qVpfkjFbiWNs6dvd5a9pe8FxMghcxA7unUP0AB5VX7sI3OGfrLQyUpx2FoMp-24qmG6ftoQC6hUL71pmRReZy35z-g2-R1jpRqwZwk5awJX_A9wO" alt="Creating your first dashboard message"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>After this, you should see an empty dashboard which doesn’t show anything:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh6.googleusercontent.com/nrNvqCZXWJaJd194VFJ31wIDFnlWbAl6-vUn04IJYorUrWhkwwB22l01J_o-WxSEGvS6cTxkvikTp3kHWG3-9GGjNS2u3A5PRfRwwAwrcKrysm1rsjmfOxoDbgEnAGwjOGCf_RBC" alt="Initial view of the empty Kibana dashboard"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Click the <strong>Add</strong> button at the top-left to add a new visualisation:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":457,"height":189} -->
<figure class="wp-block-image is-resized"><img src="https://lh5.googleusercontent.com/2ITOX0ufcf7k4oxMFWsrbzX6znK1WKMbVICT_ND_mrUJE8Na4qTy0QoBGoTG9zQKxiVMrnSKvWyVV76NrL4ufXVt1bd01EUvg9-Q44QJHCkpcWn3q72cchXoBoL1xzLh5DYJfdy6" alt="Add a new element" width="457" height="189"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>You should see the name of the <strong>saved search</strong> you created in the previous step. Choose that:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/QRkAc6vPzbv6EVPqQKRr3O8QqlRNZyomKTV5lXkDQ4LSVkRAbkHimleDp9cuA6JyXqfKnFJoriZ_sbatRFn9Bk35rxuXUQzKpEY_E_v6LPKGJB4MALQfDeazZwV36DnzbET0_jXe" alt="Select a panel to add to"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Next, resize it as you see fit and you should see the first panel in your dashboard:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/V0KPt4qbJEEqw00wz34Q3Vy74-a6k8Hz-CsjFJHHw9STU_YvQ7ALpS8q3lXrq1xqtrlmR3uw7XQzbShAtBcDn24SX_8W8GhU-c2_EjqWvVxcDDOUj8F6OoRaWlhCpK2LOGW8q7Ut" alt="Adding the saved search"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This view is great for inspecting the details of all requests &amp; using it for additional filtering on a given property.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>However, we will need to add some more visualisations to be able to see aggregations of the data in our dashboard.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Save your new dashboard with a descriptive name and proceed to the next section:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":572,"height":292} -->
<figure class="wp-block-image is-resized"><img src="https://lh5.googleusercontent.com/Ro1XT4eK8OpXt04bx9p-iW-bGnY40exiPHMuv43rMEbqEiAJOjjoTrAnINrYGZ7MqPhoJnQ5RSKVhbXjUPCd5ArAK4WounbDc2EvxYVpiV-NMR7WctmZxqXX-9UVeKVX_Zl2EwoX" alt="Saving the Kibana dashboard" width="572" height="292"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"level":3} -->
<h3>Add a data table to monitor requests per endpoint</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In this step, we will create a <strong>data table</strong> which will show how many requests we get per endpoint.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Click the <strong>Edit</strong> button at the top-left to edit the contents of the dashboard and select <strong>Add</strong> to create a new view.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the panel which pops up, create a new visualisation from the bottom-left:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":232,"height":169} -->
<figure class="wp-block-image is-resized"><img src="https://lh4.googleusercontent.com/6Lm9lMxk027D2vlNr6EKco_7-YuU0trRDF4n36_RT-gzutB-JhJJmsSCO5bEe2hbL6yMq-VXnXNAwEmCQdl_dnmB4d-D4f8XMempHG3VBN3iI0w3rnnMEXo3wjf1_pbJlsjJwkG7" alt="Create a new visualization" width="232" height="169"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Next, create a new data table:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh6.googleusercontent.com/VU5aqUm8NHSNtjEauRaYk2fQuRQJufcTxDCt4ncttf3bLUTI1fixrr4vpleagwKLDnaN3rAmJAvVzohiBuCFqjsj7lhxBBcLbnfpjJdinBXlMFtCenCUwau1J9k6P63oNQHCsAv-" alt="Picking a visualization template"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>On the next screen, select your <strong>saved search</strong>’s name as the data source to use.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Afterwards, you should see a screen which simply shows the total count of requests in a table. This is because the table currently aggregates all requests &amp; shows the total count for them.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>We will aggregate the data in the table by the <strong>endpoint</strong> keys. This will show the count of each request per endpoint.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To do this, add a new <strong>Bucket </strong>which splits rows:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":305,"height":213} -->
<figure class="wp-block-image is-resized"><img src="https://lh5.googleusercontent.com/Ea3DRqBlyXrF2T8AxMcpwZfaS4RHm1YjLN6FZblmzYYh33mjHtvuxFdAmv5GNvNsPvYUAN8iPwv_Gqg2YoHNsmBHJZN8IBqfs-S7eHKunWLhdD1cYUnu9ZNhyi64x-PVrsPAPCrq" alt="Split rows setting" width="305" height="213"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>As an aggregation, use <strong>Terms</strong>. This is a simple aggregation which simply groups the data by the unique values for the key we’ll choose:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":315,"height":335} -->
<figure class="wp-block-image is-resized"><img src="https://lh3.googleusercontent.com/OnjB7XL7F0DUbIpV5c4RseX8j8VTEpyLujiFsh8QZsB4DNJDesrRxmYn4FHRm5OSBhT86ninZhPu5F1AFaSPi9C7_xi_FqWQiu2rNHy3gJiDGYbLWD3mnZdphPLYCveI7lJ1j8kq" alt="Aggregating by Terms" width="315" height="335"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Aggregate by the endpoint key and use the following configuration:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":315,"height":501} -->
<figure class="wp-block-image is-resized"><img src="https://lh6.googleusercontent.com/vLSF0mZnVoe6r8I9YJ7AJkvmHNagHCFnfmKPPj3DcrvyAUaiF91CuH9XnHErDDK1UfhcDGEg4k0HR6uE2Z6O5p_bq5uhCFmzrC8xpD7hEpC7-nKi46YViQOebtU1sZxmsDF1znRN" alt="The aggregation settings" width="315" height="501"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The Group other values in separate bucket will display all data which is too little and doesn’t fit in the table (the limit is 5 rows, which we specify) in a general <strong>“Other”</strong> bucket.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For example, if we had 7 different endpoint and five of them get 80% of the traffic, the 20% other values will be aggregated in a row called <strong>“Other”</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Now, click the Play button at the top of the window to see how your table looks. You should see the count of requests per endpoint:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/CAJmDkpnhc23grSBSFU9A7aGT0IQPt99JbO7nHxUwFoOdw85b216h4LZaJ7kPHathqxXzsow4wdV1WRfd-_cXOSi96rg0UHI6aVX_jqp0HLUMHtRX3c7R3lnRaFT5xtPQIA_Qjbw" alt="Initial view after aggregation"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This view now looks quite useful. With it, we can track how much traffic we get per endpoint. Click the <strong>Save</strong> button at the top-left, give the new view a title (e.g. <strong>Calls by Endpoints</strong>) and rearrange your dashboard to look aesthetically pleasing:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/bM48fmgIUWuWRSDnCtfODM_C-dWyU759Fn_0X8IJ5d6IBili-hwx_5ir0UMP1SDY33opCN9y2UiMLzpN6ZWv-LoiAijEG-MsWcJNI77py6Al5r_Nq_n3RqZN4Ov0i7nuovbk0HZo" alt="Adding the new visualization"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Let’s now do the same for the rest of our significant fields.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Add a data table for all significant fields</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In this step, add a new table, following the same steps as the previous one, for <strong>method, countryISO2, userType </strong>and<strong> paymentMethod</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>There is no need to include a view for <strong>userID</strong> as the granularity of that field is typically way too big to make a sensible dashboard.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>However, you can usually take that by making custom filters on some of the log lines in the saved search view.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After you go through this, here is what the dashboard should look like:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/0xWb_4KToEpnubYP_HCUZt_xA4SauxjOey0o5Rm5pIbp3M2_1JF62WOnYTAxcHpvMj0hskIho8t0Z309wC_Zn4Phw0iLqOCNXeFlLSAfns0yWmcamVFj07ae_l66eATgR16JPYj6" alt="Adding all data tables"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Now, you can see aggregations for all significant data points you are interested in.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you want to further inspect e.g. what payment methods one uses when calling the <strong>/payments/execute</strong> endpoint, you can “zoom in” on the data by filtering for that data.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Try it out and explore for yourself:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh3.googleusercontent.com/EiwZazuFfHFDja9xHOlHFA4g6tq9QOmS-VasvNBFa8dAPKssp_HkoFRFrjxSlComlia2_hu27UjDJ-XKyU-exdy_2hHDBbQXIUYKwKQoCz3kOxrS_MTmdAUM9MuOg8jB8om43FNw" alt="Filtering by a given field"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Here is a challenge for you, zoom in on the <strong>errors</strong> and identify which is the endpoint which has the most errors.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The scope of this exercise is creating the dashboard, but don’t worry. You will get to play with it in the following exercise.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Our dashboard already looks quite informative.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But there is one final touch it needs.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":3} -->
<h3>Add a histogram for tracking success/error rate</h3>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>In this step, we will diverge from the good old data table and add a histogram to track the <strong>success-to-error</strong> ratio over time.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The rest of the views in the dashboard are typically used to find the root cause of an issue.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The view we’ll create now will enable us to quickly identify if there is an issue.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Create a new visualisation, but this time, select a <strong>Vertical Bar</strong>:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":614,"height":482} -->
<figure class="wp-block-image is-resized"><img src="https://lh3.googleusercontent.com/_8J7Rde6OK8aEqNkJqMjBBXQVv-usxg0Rw0WNvsL6s9MNq6z88SCs6JHGAARGnpDHTu94UUbnjpFYpJY7yb2DqS1FU_Fzo8ABWsICbRHwUaRDmF7xhAK6dMr3WxVwSKhCCQs3kuf" alt="Adding a histogram" width="614" height="482"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>In the beginning, you will simply see a single bar with the total count of requests in the given time period.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>For starters, add an X-Axis which will create time intervals for each of the lines in the histogram. This will allow us to see the tendency of events over time.</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/B19Ck1BBahMGnlJ3YHe_5tcJjdhP_KcPv7rzgW_qplBVJtX8dfD-eXiTLk439QLpBCi9tbR8Oa5E0G0x9tZh5WH0zDWn81MTWSmCda860aTJ_GY4UQqV4d8MyCYdX7ymIO5GkQ3M" alt="Choosing the X-Axis"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This time, the selected aggregation is Date histogram on the @timestamp field:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":316,"height":521} -->
<figure class="wp-block-image is-resized"><img src="https://lh6.googleusercontent.com/TBUXiBsUAO0SZI2ivGataKkLHj_Q8l_oq2EOwgQ6S8QDAzwjszmlfqreRHYnpAwegSr1EU_5mbWaIX-1n8Eo80Qf5ryyvK3lyIwPNNFYTQEv-Fy6sCA4kSHatLicO8VJVm58MNje" alt="X-Axis settings" width="316" height="521"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Click the <strong>Play</strong> button and see how the view changes to reflect the count of events over time:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/qExMoMPhtNFolD4fVbY4t764bHmJiIEmcZp8GWwejRAzAua41mzIKSXmqz-jfs1nHvtTcy6nim-Tar4PCNEIEh-pU8DF1Tdbwj9jBeJ8VWWnLCzuEeD9iVG7yqIGwV2KiB6fSU8c" alt="Initial histogram"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This is cool, but it would be useful if we could actually see how many of those requests are success and how many are errors.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>To do this, let’s customize the existing Y-Axis to only aggregate successful requests.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>First, change the Y-Axis aggregation from Count to <strong>Sum bucket</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Then, use <strong>Filters</strong> as the <strong>Bucket</strong> aggregation. This will allow us to use KQL (Kibana Query Language) to make any custom filter we like.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Add a filter which says select all messages which are not empty strings:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":302,"height":397} -->
<figure class="wp-block-image is-resized"><img src="https://lh4.googleusercontent.com/AuHwKgmQA_Wzo56ryHueplQGmutENBR-TX4mF9Xo4xxXaKNE4nrVwSg_LxpR2s9y1LfqVmk40VgWaY0W5zhmvRybutXl4IjyEXcHS8G7lAPw9wnjjS3tdli9P3rH_0n_lKhdoBCW" alt="Setting up the Y-Axis" width="302" height="397"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Next, add a custom label <strong>“Success”</strong> for this Y-Axis at the bottom of the panel.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Click the Play button to see the results. You should now see the number of successful requests every 30s. The default color, however, is a bit off, so change it at the top-right to green:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":360,"height":251} -->
<figure class="wp-block-image is-resized"><img src="https://lh3.googleusercontent.com/S6bwh01v6y1l4dH7l_lmm80jUmNBkuwvt6jp7LzjeoDhJW0aZmoQoRqo1uKobvJgoUHY8Y6nwaY7dxKeXXj7Dq6rHMr6wk5mdKGgp6Xp095AhJpUCxugGBGvYLPX1pMcG_CvEKIY" alt="Choosing a histogram color" width="360" height="251"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Now, it looks a lot better:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/y7CDOe4YE3xHDwRqIZIa7X7LZ-zIVanmC4Lva1kOdRVtwMtTeVYqQH4mVxFFr57agI-I7XMUfUS551BX0RZNwqNqwBo79-pW4XOBqL2kzxaz2cA8HMgkWWNnrQIjOSYuHQkWTVRs" alt="Result after changing color"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>We aren’t done yet.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>It’s now time to stack the <strong>errors</strong> on this Y-Axis as well.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Collapse the current Y-Axis settings and add a new one:</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":314,"height":314} -->
<figure class="wp-block-image is-resized"><img src="https://lh4.googleusercontent.com/r51mHHvUWrY1v-9hVHInp8LDH_eotdD_QTuAxxjdBj_I6fQOgnhaxzS3EWev3T7un2R58KCm2l__AuaJy8lyHyZ5531N0LhpXi7Z9QCwoNJJWy70CBlM5x3tvjr5AmdUhg4DQQur" alt="Adding the Y-Axis metric" width="314" height="314"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>The setup for this Y-Axis is simpler.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Choose <strong>Sum bucket</strong> as an aggregation again and <strong>Terms</strong> as an aggregation for the bucket. Choose <strong>errors.keyword</strong> as the field to use.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Keep the rest of the settings as-is.</p>
<!-- /wp:paragraph -->

<!-- wp:image {"width":324,"height":395} -->
<figure class="wp-block-image is-resized"><img src="https://lh3.googleusercontent.com/YR8U2O3MnC_7OuoKsouugdvgKOFX0t89bJqPQ64_aKyYowMK-jfJrQ1ZWEyZrgXFW9v2js-Y4sYBUKEjIHBce888TZL0irSgoIxeBr83VQkttxTVL9GLheRrsCM4wh-M6K6J-AX9" alt="Y-Axis metric setup" width="324" height="395"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>Add a custom label <strong>“Errors”</strong>, change the color to red and here’s what you get:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh4.googleusercontent.com/0veByMCfwOGbMoc8g3KQ4eAUrb7qF63y5Wycud1lJ3WpWosPVqGmcbRdyr3GGEBa0wF61O2mvpW5SQFx1vRZE4y1xpcJ-Gu87AHVpDNsS_QdgJyfE-HSBUHLzK5VSSY9BvNv7UAL" alt="Success to error ratio"/></figure>
<!-- /wp:image -->

<!-- wp:paragraph -->
<p>This is the success-to-error ratio, aggregated per 30s.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>This view will now enable you to see the % of errors for all endpoints with a single glance.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You could also zoom in on the data again and see the % of errors per endpoint/payment method/userType/etc.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Save this view, add it to your dashboard, arrange it nicely at the top and gaze at your beautiful application dashboard:</p>
<!-- /wp:paragraph -->

<!-- wp:image -->
<figure class="wp-block-image"><img src="https://lh5.googleusercontent.com/ul1DY26Rc2lzZMT6um6-fKpJPiHj-8oJZ1zNSKFgh-6ry4qZgF3Q-rB1vOsb-BafHVsqXlo1n8BW-YgX6nPROxejdllPnai3cskLu_XNPpOsaMHUWI5idFsuBKw7EzTU8xUAx_vX" alt="Final dashboard"/></figure>
<!-- /wp:image -->

<!-- wp:heading -->
<h2>Finale</h2>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Congratulations. 👏👏👏</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You’ve successfully completed the tutorial.&nbsp;</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>You should now have a decent practice using Kibana to create basic dashboards for your application.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>The final step of this exercise is to add such a dashboard for your real production application, buy a 146-inch monitor, attach it to the wall in your office, open your app’s dashboard, enter full-screen and enable <strong>Auto-refresh</strong>.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>After you do this, all your colleagues from the other teams will stare at it enviously.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>But unless you know how to effectively use Kibana for debugging real production issues, that’s all the value you’ll get from it - a shiny dashboard to show-off with in the office.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In the following tutorial, you’ll learn how to now capitalize on this dashboard and use it to instantly discover the root cause of production issues.</p>
<!-- /wp:paragraph -->