Charting the number of method requests by type and host

In our environment, where multiple hosts are responding to web requests for customers who browse the website, it is good to get an idea of the current number of each method request split by the host. Methods relate to request/response actions between a customer's web client and our web hosts. Having this type of information can enable us to understand if these requests are properly being balanced across the hosts or if one host is receiving the majority of the load.

In this recipe, you will write a Splunk search to chart the number of method requests split by type and host. You will then graphically represent these values on a dashboard, using a column chart.

Getting ready

To step through this recipe, you will need a running Splunk Enterprise server, with the sample data loaded from Chapter 1, Play Time – Getting Data In. You should be familiar with the Splunk search bar, the time range picker, and the Visualization tab. It is not required, but is advisable, that you also complete all the recipes up until this point.

How to do it…

Follow the given steps to chart the number of method requests by type and host:

  1. Log in to your Splunk server.
  2. Select the default Search & Reporting application.
  3. Ensure that the time range picker is set to Last 24 hours and type the following search into the Splunk search bar. Then, click on Search or hit Enter:
    index=main sourcetype=access_combined | chart count by host,method
  4. Splunk will return a tabulated list of the total counts for each method request split by host.
  5. Click on the Visualization tab.
  6. Click on the dropdown that lists the visualization types and select Column.
  7. Your data should now be visualized as shown in the following screenshot:
    How to do it…
  8. Save this report by clicking on Save As and then on Report. Name the report cp03_methods_by_host and click on Save. On the next screen, click on Add to Dashboard.
  9. You will now add this to the Website Monitoring dashboard. Select the button labeled Existing, and from the drop-down menu that appears, select the Website Monitoring dashboard. For the Panel Title field value, enter Method Requests by Type and Host and select Report in the Panel Powered By field; then, click on Save.
  10. The next screen will confirm that the dashboard has been created and the panel has been added. Click on View Dashboard to see for yourself.
  11. Edit the dashboard to position the column chart visualization below the previously added panels.

How it works…

Let's break down the search piece by piece:

Search fragment

Description

index=main sourcetype=access_combined

You should now be familiar with this search from the earlier recipes.

| chart count by host,method

The chart command simply performs a count of events split by host and method. This produces the total count of each method for a given host.

The Visualization tab simply takes the tabulated output of the stats command and overlays the given visualization. In this case, you overlaid a column chart visualization on the total count for each method split by host.

See also

You can refer to the following recipes for more information:

  • The Using a gauge to display the number of errors recipe
  • The Creating a timechart of method requests, views, and response times recipe
  • The Using a scatter chart to identify discrete requests by size and response time recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.109.151