28. Access log sampler Step-by-step

This is a short tutorial on JMeter's access log sampler. The purpose of the Access Log Sampler is to provide an easy way to simulate production traffic. There are several benefits to using access logs.

The down side of using access logs for test plans is you have to configure the webserver to output the request information. This may not be appropriate where security is an issue. For example, if the webserver dumps the post data from each request to the access logs, users login and password would be stored in plain text. Here are some general cases where access logs might be inappropriate.

To take advantage of access logs, the first thing is the webserver needs to be configured to use extended log format. Links for configuring the popular containers are provided below.

In some cases, it may be desirable to write custom logging, so that sensitive information is not written to the access logs. This article does not cover the techniques for writing custom logging.

28.1 Step-by-Step

  1. Start JMeter
  2. Select Test Plan
  3. Right click Add → Threads (Users) → Thread Group
    Add Thread Group
    Add Thread Group
  4. Select Thread Group
  5. Right click Add → Sampler → Access Log Sampler
    Add Access Log Sampler
    Add Access Log Sampler
  6. Right click on Thread Group Add → Listener → Aggregate Report
    Add Aggregate Report
    Add Aggregate Report
  7. Select the Access Log Sampler
    Access Log Sampler
    Access Log Sampler
  8. Enter the IP address or hostname in Server
  9. Enter the port in Port
  10. If you want to download the images, set Parse images to true.
  11. Select a file for Log File Location
    Filled in Access Log Sampler
    Filled in Access Log Sampler
  12. Select Aggregate Report
  13. Enter results.jtl for filename
    Aggregate Report with filename
    Aggregate Report with filename

At this point, the test plan is ready. Start the test with Ctrl + R or from the menu Start → Run.

Go to top