• Stars
    star
    1,108
  • Rank 41,912 (Top 0.9 %)
  • Language
    Go
  • License
    MIT License
  • Created about 7 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŽฉ A fake log generator for common log formats

Flog

go report card travis ci docker download

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 -u 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      log format. available formats:
                           - apache_common (default)
                           - apache_combined
                           - apache_error
                           - rfc3164
                           - rfc5424
                           - json
  -o, --output string      output filename. Path-like is allowed. (default "generated.log")
  -t, --type string        log output type. available types:
                           - stdout (default)
                           - log
                           - gz
  -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 duration     fix creation time interval for each log (default unit "seconds"). It does not actually sleep.
                           examples: 10, 20ms, 5s, 1m
  -d, --delay duration     delay log generation speed (default unit "seconds").
                           examples: 10, 20ms, 5s, 1m
  -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 whenever the maximum number of lines is reached.
                           with "byte" option, the logs will be split whenever the maximum size in bytes is reached.
  -w, --overwrite          overwrite the existing log files.
  -l, --loop               loop output forever until killed.
# Generate 1000 lines of logs to stdout
$ flog

# Generate 200 lines of logs with a time interval of 10s for each log. It doesn't actually sleep while generating
$ flog -s 10s -n 200 

# 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 300ms. It actually sleep (delay) while generating
$ flog -t gz -o log.gz -n 3000 -d 10s

# Generate logs up to 10MB and split log files every 1MB in "web/log/*.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 until killed
$ flog -f rfc3164 -l

Supported Formats

  • Apache common
  • Apache combined
  • Apache error
  • RFC3164
  • RFC5424
  • Common log fomat
  • JSON

Supported Outputs

  • Stdout
  • File
  • Gzip

License

MIT

More Repositories

1

diagrams

๐ŸŽจ Diagram as Code for prototyping cloud system architectures
Python
37,551
star
2

go-web-framework-stars

โญ Web frameworks for Go, most starred on GitHub
Go
3,555
star
3

git-tips

๐Ÿ“š Git ํŒ ๋ชจ์Œ์ง‘ (https://github.com/git-tips/tips ํ•œ๊ตญ์–ด ๋ฒ„์ „)
1,022
star
4

commonregex

๐Ÿซ A collection of common regular expressions for Go
Go
861
star
5

go-todo-rest-api-example

๐Ÿ“š A RESTful API example for simple todo application with Go
Go
523
star
6

awesome-finder

๐Ÿ˜Ž Search the awesome curated list without browser
Python
275
star
7

blockchain-tutorial

๋ธ”๋ก์ฒด์ธ ํŠœํ† ๋ฆฌ์–ผ (Building Blockchain in Go ํ•œ๊ตญ์–ด ๋ฒ„์ „)
106
star
8

cfmt

๐ŸŽจ Contextual fmt inspired by bootstrap color classes
Go
103
star
9

pyreportcard

๐Ÿšฅ A report card for Python application
Python
100
star
10

funmath

โ˜” Implementations of mathematical functions, formulas and concepts
Python
91
star
11

python-web-framework-stars

โญ๏ธ Web frameworks for Python, most starred on Github
Python
73
star
12

round

๐ŸŒ€ A command-line for rounding the images
Go
59
star
13

gobyexample

๐ŸŽ Go By Example ํ•œ๊ตญ์–ด ๋ฒ„์ „
HTML
57
star
14

gosearch

๐Ÿ” Search the Go packages via command-line
Go
55
star
15

python-curses-scroll-example

๐Ÿ“บ How to implement the scroll and paging in Python curses
Python
48
star
16

redis-migrate

๐Ÿ“ฎ Simple command line tool for redis data migration (minimal functionality)
Python
40
star
17

gomo

๐Ÿ” Terminal based memo application written in Go
Go
40
star
18

sorting

๐Ÿก Visualize the process of sorting algorithms simply
Python
25
star
19

mingrammer

mingrammer
25
star
20

go-codelab

๐Ÿฐ Simple codelab for learning Go language (simple and tiny IoT service)
Go
20
star
21

sheet2db

A tiny python library for syncing data from google spreadsheet to database
Python
20
star
22

casec

๐ŸŒˆ A text case converter
Go
14
star
23

clip

๐Ÿ“Ž A simple key-value store for clipboard
Go
11
star
24

architecture-by-me

A collection of architectures made by myself
10
star
25

fitter

๐Ÿญ An on-demand image server for generating dynamic images
Python
10
star
26

cs231n-numpy-tutorial

IPython notebook for cs231n python numpy tutorial
Jupyter Notebook
7
star
27

tyfy

Truthy and falsy text validators
Go
6
star
28

docker-complex-app

Example repository for testing the CI/CD flow with multi-docker
JavaScript
5
star
29

os-assign

OS programming assignment
C
5
star
30

homebrew-flog

Homebrew tap repository for github.com/mingrammer/flog
Ruby
4
star
31

dynamodb-toolkit

A command line toolkit for aws dynamodb
Go
4
star
32

dotfiles

mingrammer's dotfiles
Vim Script
3
star
33

mingrammer.github.io

๐Ÿณ mingrammer's note
CSS
3
star
34

python-practices

๐Ÿ A cureated collection of python practices for various topics
Python
3
star
35

go-mod-onbuild

๐Ÿณ Go + module onbuild image
Dockerfile
3
star
36

problem-solving

A collection of problem solving solutions
Python
2
star
37

bit-counter

๐Ÿ’ก A simple bit counter
Python
2
star
38

go-simple-crawler-practice

Simple crawler for learning go
Go
2
star
39

meetup-api

API & Slack bot RTM server for 9XD meetup service
Go
2
star
40

deep-learning-from-scratch

Jupyter notebooks for "deep learning from scratch" book
Jupyter Notebook
1
star
41

atom-settings

my settings for atom editor
CoffeeScript
1
star
42

wiki

My personal wiki
1
star
43

project-euler

A collection of project euler solutions
Python
1
star
44

go-simple-chat-practice

Simple chat server for learning go
Go
1
star
45

coursera-machine-learning

Exercises for coursera machine learning course
MATLAB
1
star
46

docker-react

Example repository for testing the CI/CD flow with docker
JavaScript
1
star