Tutorial: Create a dashboard of panels with web server data

edit

Tutorial: Create a dashboard of panels with web server data

edit

You collected data from your web server, and you want to visualize and analyze the data on a dashboard. To create dashboard panels of the data, open the Lens visualization builder, then create the visualization panels that best display the data.

When you’ve completed the tutorial, you’ll have a dashboard that provides you with a complete overview of your web server data.

Final dashboard vis

Add the data and create the dashboard

edit

To create visualizations of the data from the web server, add the data set, then create the dashboard.

  1. From the Kibana Home page, click Try our sample data.
  2. From Sample web logs, click Add data.
  3. Open the main menu, click Dashboard.
  4. Click Create dashboard.

Open and set up Lens

edit

With Lens, you identify the data fields you want to visualize, drag and drop the fields, then watch as Lens uses heuristics to apply the fields and create a visualization for you.

  1. From the dashboard, click Create panel.
  2. On the New visualization window, click Lens.

    New visualization popover
  3. Make sure the kibana_sample_data_logs index appears.

View the number of website visitors

edit

To determine how many users have visited your website within the last 90 days, create a metric visualization, then add it to the dashboard.

  1. Set the time filter to Last 90 days.
  2. From the Chart Type dropdown, select Metric.

    Chart Type dropdown with Metric selected
  3. From the Available fields list, drag and drop clientip to the visualization builder.

    Changed type and dropped clientip field
  4. In the editor, click Unique count of clientip.

    1. In the Display name field, enter Unique visitors.
    2. Click Close.

      Flyout config open
  5. Click Save and return.

View the distribution of visitors by operating system

edit

To determine the operating systems you should continue to support, and the importance of mobile traffic from iOS devices, create a donut chart that displays the top operating systems that your visitors used to access your website within the last 90 days.

  1. Open Lens, then set the time filter to Last 90 days.
  2. From the Chart Type dropdown, select Donut.
  3. From the Available fields list, drag and drop the data fields to the Drop a field or click to add fields in the editor.

    1. Drag and drop clientip to the Size by field.
    2. Drag and drop machine.os.keyword to the Slice by field.

      Donut chart with clientip and machine.os.keyword fields
  4. Change the color palette.

    1. In the editor, click Top values of machine.os.keyword.
    2. From the Color palette dropdown, select Compatibility.
    3. Click Close.

      Donut chart with open config panel
  5. Click Save and return.

View the average of bytes transfer per day

edit

To prevent potential server failures, and optimize the cost of website maintenance, create an area chart that displays the average of bytes transfer. To compare the data to the number of visitors to your website, add a line chart layer.

  1. Open Lens.
  2. From the Available fields list, drag and drop bytes to the visualization builder.
  3. To zoom in on the data you want to view, click and drag your cursor across the bars.

    Zoom in on the data
  4. Change the timestamp interval.

    1. In the editor, click timestamp.
    2. Select Customize time interval.
    3. Change the Minimum interval to 1 days, then click Close.

      Customize time interval
  5. From the Chart Type dropdown, select Area.

Add the line chart layer

edit

To compare the average of bytes transfer to the number of users that visit your website, add a line chart layer.

  1. In the editor, click +.

    Add new layer button
  2. From the new layer editor, click the Chart type dropdown, then click the line chart.

    Change layer type

    The chart type for the visualization changes to Mixed XY.

  3. From the Available fields list, drag and drop the data fields to the Drop a field or click to add fields in the editor.

    1. Drag and drop timestamp to the Horizontal axis field.
    2. Drag and drop clientip to the Vertical axis field.
  4. Change the timestamp interval.

    1. In the editor, click timestamp in the line chart layer.
    2. Select Customize time interval.
    3. Change the Minimum interval to 1 days, then click Close.
  5. Change the Unique count of clientip label and color.

    1. In the editor, click Unique count of clientip.
    2. In the Display name field, enter Unique visitors in the line chart layer.
    3. In the Series color field, enter #CA8EAE, then click Close.

Configure the y-axes

edit

There is a significant difference between the timestamp per day and Unique visitors data, which makes the Unique visitors data difficult to read. To improve the readability, display the Unique visitors data along a second y-axis, then change the formatting. When functions contain multiple formats, separate axes are created by default.

  1. In the editor, click Unique visitors in the line chart layer.
  2. For Axis side, click Right, then click Close.

Change the visualization type

edit
  1. In the editor, click Average of bytes in the area chart layer.
  2. From the Value format dropdown, select Bytes (1024), then click Close.

    Multiaxis chart

Change the legend position

edit

The visualization is done, but the legend uses a lot of space. Change the legend position to the top of the chart.

  1. From the Legend dropdown, select the top position.

    legend position
  2. Click Save and return.

View the health of your website

edit

To detect unusual traffic, bad website links, and server errors, create a percentage stacked area chart that displays the associated response codes.

  1. Open Lens.
  2. From the Available fields list, drag and drop the data fields to the Drop a field or click to add fields in the editor.

    1. Drag and drop Records to the Vertical axis field.
    2. Drag and drop @timestamp to the Horizontal axis field.
  3. From the Chart Type dropdown, select Percentage bar.
  4. To remove the vertical axis label, click Left axis, then deselect Show.

    Turn off axis name

Add the response code filters

edit

For each response code that you want to display, create a filter.

  1. In the editor, click the Drop a field or click to add field for Break down by.
  2. From Select a function, click Filters.
  3. Add the filter for the successful response codes.

    1. Click All records.
    2. In the KQL field, enter response.keyword>=200 AND response.keyword<300.
    3. In the Label field, enter 2XX, then press Return.

      First filter in filters aggregation
  4. Add the filter for the redirect codes.

    1. Click Add a filter.
    2. In the KQL field, enter response.keyword>=300 AND response.keyword<400.
    3. In the Label field, enter 3XX, then press Return.
  5. Add the filter for the client error codes.

    1. Click Add a filter.
    2. In the KQL field, enter response.keyword>=400 AND response.keyword<500.
    3. In the Label field, enter 4XX, then press Return.
  6. Add the filter for the server error codes.

    1. Click Add a filter.
    2. In the KQL field, enter response.keyword>=500 AND response.keyword<600.
    3. In the Label field, enter 5XX, then press Return.
  7. To change the color palette, select Status from the Color palette dropdown, then click Close.
  8. Click Save and return.

View the traffic for your website by the hour

edit

To find the best time to shut down your website for maintenance, create a histogram that displays the traffic for your website by the hour.

  1. Open Lens.
  2. From the Available fields list, drag and drop bytes to Vertical axis in the editor, then configure the options.

    1. Click Average of bytes.
    2. From Select a function, click Sum.
    3. In the Display name field, enter Transferred bytes.
    4. From the Value format dropdown, select Bytes (1024), then click Close.
  3. From the Available fields list, drag and drop hour_of_day to Horizontal axis in the editor, then configure the options.

    1. Click hour_of_day.
    2. Click and slide the Intervals granularity slider until the horizontal axis displays hourly intervals.

      Create custom ranges
  4. Click Save and return.

View the percent of small versus large transferred files

edit

To determine if your users transfer more small files versus large files, create a pie chart that displays the percentage of each size.

  1. Open Lens.
  2. From the Available fields list, drag and drop bytes to Vertical axis in the editor, then configure the options.

    1. Click Average of bytes.
    2. From Select a function, click Sum, then click Close.
  3. From the Available fields list, drag and drop bytes to Break down by in the editor, then specify the file size ranges.

    1. Click bytes.
    2. Click Create custom ranges, enter the following, then press Return:

      • Ranges010240
      • LabelBelow 10KB
    3. Click Add range, enter the following, then press Return:

      • Ranges10240+∞
      • LabelAbove 10KB

        Custom ranges configuration
    4. From the Value format dropdown, select Bytes (1024), then click Close.
  4. From the Chart Type dropdown, select Pie.

    Files size distribution
  5. Click Save and return.

View the top sources of website traffic

edit

To determine how users find out about your website and where your users are located, create a treemap that displays the percentage of users that enter your website from specific social media websites, and the top countries where users are located.

  1. Open Lens.
  2. From the Chart Type dropdown, select Treemap.
  3. From the Available fields list, drag and drop Records to the Size by field in the editor.
  4. In the editor, click the Drop a field or click to add field for Group by, then create a filter for each website traffic source.

    1. From Select a function, click Filters.
    2. Click All records, enter the following, then press Return:

      • KQLreferer : *facebook.com*
      • LabelFacebook
    3. Click Add a filter, enter the following, then press Return:

      • KQLreferer : *twitter.com*
      • LabelTwitter
    4. Click Add a filter, enter the following, then press Return:

      • KQLNOT referer : *twitter* OR NOT referer: *facebook.com*
      • LabelOther
    5. Click Close.

Add the geographic data

edit

To determine the top countries where users are located, add the geographic data.

Compare the top sources of website traffic data to the top three countries.

  1. From the Available fields list, drag and drop geo.src to the visualization builder.
  2. To change the Group by order, click and drag Top values of geo.src so that it appears first in the editor.

    Treemap vis
  3. To view only the Facebook and Twitter data, remove the Other category.

    1. In the editor, click Top values of geo.src.
    2. From the Advanced dropdown, deselect Group other values as "Other", then click Close.

      Group other values as Other
  4. Click Save and return.

Save the dashboard

edit

Now that you have a complete overview of your web server data, save the dashboard.

  1. In the toolbar, click Save.
  2. On the Save dashboard window, enter Web server data, then click Save.