Giter Club home page Giter Club logo

fake-apache-log-generator's Introduction

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 apache-fake-log-gen.py  

Generate 100 log lines into a .log file

$ python apache-fake-log-gen.py -n 100 -o LOG 

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

$ python apache-fake-log-gen.py -n 100 -o GZ -s 10

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

$ python apache-fake-log-gen.py -n 0 -o LOG 

Prefix the output filename

$ python apache-fake-log-gen.py -n 100 -o LOG -p WEB1

Detailed help

$ python apache-fake-log-gen.py -h
usage: apache-fake-log-gen.py [-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
  --num NUM_LINES, -n NUM_LINES
                        Number of lines to generate (0 for infinite)
  --prefix FILE_PREFIX, -p FILE_PREFIX
                        Prefix the output file name
  --sleep SLEEP, -s SLEEP
                        Sleep this long between lines (in seconds)

Requirements

  • Python 2.7
  • pip install -r requirements.txt

License

This script is released under the Apache version 2 license.

fake-apache-log-generator's People

Contributors

aojea avatar atiaxi avatar csmanioto avatar kiritbasu avatar wreckoner avatar zhangoose avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.