Fake Apache Log Generator

快速生成大量伪造的 Apache 日志文件。「Generate a boatload of Fake Apache Log files very quickly」

Github星跟蹤圖

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.

主要指標

概覽
名稱與所有者kiritbasu/Fake-Apache-Log-Generator
主編程語言Python
編程語言Python (語言數: 1)
平台
許可證Apache License 2.0
所有者活动
創建於2015-12-18 18:36:52
推送於2024-05-09 01:50:24
最后一次提交2018-03-15 14:19:01
發布數0
用户参与
星數282
關注者數12
派生數239
提交數22
已啟用問題?
問題數6
打開的問題數6
拉請求數6
打開的拉請求數8
關閉的拉請求數5
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?