Generate a boatload of Fake Apache Log files very quickly
Switch branches/tags
Nothing to show
Clone or download
kiritbasu Merge pull request #9 from aojea/CLF
Added Common Log Format output
Latest commit 06c38c5 Mar 15, 2018

Fake Apache Log Generator

This script generates a boatload of fake apache logs very quickly. Its useful for generating fake workloads for data ingest and/or analytics applications.

It can write log lines to console, to log files or directly to gzip files.

It utilizes the excellent Faker library to generate realistic ip's, URI's etc.

Basic Usage

Generate a single log line to STDOUT

$ python  

Generate 100 log lines into a .log file

$ python -n 100 -o LOG 

Generate 100 log lines into a .gz file at intervals of 10 seconds

$ python -n 100 -o GZ -s 10

Infinite log file generation (useful for testing File Tail Readers)

$ python -n 0 -o LOG 

Prefix the output filename

$ python -n 100 -o LOG -p WEB1

Detailed help

$ python -h
usage: [-h] [--output {LOG,GZ,CONSOLE}]
                              [--num NUM_LINES] [--prefix FILE_PREFIX]
                              [--sleep SLEEP]

Fake Apache Log Generator

optional arguments:
  -h, --help            show this help message and exit
  --output {LOG,GZ,CONSOLE}, -o {LOG,GZ,CONSOLE}
                        Write to a Log file, a gzip file or to STDOUT
                        Number of lines to generate (0 for infinite)
                        Prefix the output file name
  --sleep SLEEP, -s SLEEP
                        Sleep this long between lines (in seconds)


  • Python 2.7
  • pip install -r requirements.txt


This script is released under the Apache version 2 license.