8000 GitHub - tcprbs/flog at v0.2.3
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tcprbs/flog

Repository files navigation



Flog

A fake log generator for common log formats




flog is a fake log generator for common log formats such as apache-common, apache error and RFC3164 syslog.

It is useful for testing some tasks which require log data like amazon kinesis log stream test.

Thanks to gofakeit 😘

Installation

Using go get

go get github.com/mingrammer/flog

It is recommended to also run dep ensure to make sure that the dependencies are in the correct versions.

Using homebrew

brew tap mingrammer/flog
brew install flog

Using .tar.gz archive

Download gzip file from Github Releases according to your OS. Then, copy the unzipped executable to under system path.

Using docker

docker run -it --rm mingrammer/flog

Usage

There are useful options. (flog --help)

Options:
  -f, --format string      Choose log format. ("apache_common"|"apache_combined"|"apache_error"|"rfc3164") (default "apache_common")
  -o, --output string      Output filename. Path-like is allowed. (default "generated.log")
  -t, --type string        Log output type. ("stdout"|"log"|"gz") (default "stdout")
  -n, --number integer     Number of lines to generate.
  -b, --bytes integer      Size of logs to generate (in bytes).
                           "bytes" will be ignored when "number" is set.
  -s, --sleep numeric      Sleep interval time between lines (in seconds). It does not actually sleep every log generation.
  -p, --split-by integer   Set the maximum number of lines or maximum size in bytes of a log file.
                           With "number" option, the logs will be split every time a certain number of lines is reached.
                           With "bytes" option, the logs will be split every time a certain size in bytes is reached.
  -w, --overwrite          [Warning] Overwrite the existing log files.
  -l, --loop               Loop output forever until killed.
# Generate 1000 lines of logs to stdout
flog

# Generate a single log file with 1000 lines of logs, then overwrite existing log file
flog -t log -w

# Generate a single log gzip file with 3000 lines of logs every 10 seconds
flog -t gz -o log.gz -n 3000 -s 10

# Generate logs up to 10MB and split the log files every 1MB in "web/log/apache.log" path with apache combined format
flog -t log -f apache_combined -o web/log/apache.log -b 10485760 -p 1048576

# Generate logs in rfc3164 format infinitely
flog -f rfc3164 -l

Features

  • Completely random log generator
  • Contextual random log generator
  • Statistical random log generator
  • Support apache common, apache combined, apache error and rfc3164 log format
  • Support some other syslog formats
  • Support stdout, file and gzip type of logging

License

MIT

About

🎩 A fake log generator for common log formats

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.0%
  • Dockerfile 1.0%
0