Crates.io | fakelogs |
lib.rs | fakelogs |
version | 0.1.10-75501d4 |
source | src |
created_at | 2020-01-05 15:24:47.770335 |
updated_at | 2020-02-22 18:51:24.041041 |
description | fakelogs is a random log generator. It can be used for load testing of log parsers. |
homepage | https://gitlab.com/ufoot/fakelogs |
repository | https://gitlab.com/ufoot/fakelogs/tree/master |
max_upload_size | |
id | 195422 |
size | 58,067 |
Fakelogs is a random log generator. It can be used for load testing of log parsers.
It is written in Rust and is mostly a toy project to ramp up on the language. It might however be useful. Use at your own risk.
Current version is 0.1.10.
No install target yet, copy the fakelogs
binary in your $PATH
if you wish, that's all.
A few commands which may prove useful:
cargo build # build debug binary in ./target/debug/
cargo build --release # build release binary in ./target/release/
cargo test # launch tests
rustfmt src/*.rs # format code
./docker-build.sh # build Docker image with version tag
./bump-version.sh # bump minor version number
Simply launch:
cargo run
Or just run the binary directly:
./target/debug/fakelogs
./target/release/fakelogs
Alternatively, using docker:
docker run ufoot/fakelogs
To pass options:
cargo run -- --csv -100
By default, the generated lines follow the Apache common line format, so look like:
127.0.0.1 - james [09/May/2018:16:00:39 +0000] "GET /report HTTP/1.0" 200 123
127.0.0.1 - jill [09/May/2018:16:00:41 +0000] "GET /api/user HTTP/1.0" 200 234
127.0.0.1 - frank [09/May/2018:16:00:42 +0000] "POST /api/user HTTP/1.0" 200 34
127.0.0.1 - mary [09/May/2018:16:00:42 +0000] "POST /api/user HTTP/1.0" 503 12
There's a -c
or --csv
option, if you call fakelogs -c
you get an alternate custom CSV format:
"10.0.0.4","-","apache",1549573860,"GET /api/user HTTP/1.0",200,1234
If you pass an integer after a dash, it defines the average number of lines per second. The default is 1000. Maximum is 1000000. Eg to change the output to 10000 lines per second:
fakelogs -10000
Other standard options include:
-h
, --help
: display a short help.-v
, --version
: display version.--no-high-card
: disable high cardinality, the random 4 letters sections are replaced by xxxx
--no-time-skew
: disable time skewing, all logs look, on an average, as if they are just from now, and not 30 minutes old.--no-time-jitter
: disable time jittering, all logs have strict increasing time.--no-header
: skip the header line--no-junk
: no random junk lines--no-burst
: no random burst behavior, allows output at a constant rateThe logs may look random, but they follow a few patterns:
/section/XXXX-file.ext
or /XXXX/file.txt
with XXXX
being totally random where section can be:
yolo
(eg: /yolo/wE5d-index.html
)foo/bar
bar/foo
/w3QL/secret.txt
)pizzapino
Your attention please, this is a hack!
pops out.Fakelogs is licensed under the MIT license.