Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python:2
RUN pip install pip install faker \
numpy \
pytz \
tzlocal
COPY apache-fake-log-gen.py /
COPY requirements.txt /
COPY LICENSE /
ENTRYPOINT ["python","/apache-fake-log-gen.py"]
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ It utilizes the excellent [Faker](https://github.com/joke2k/faker/) library to g

Generate a single log line to STDOUT
```
$ python apache-fake-log-gen.py
$ python apache-fake-log-gen.py
```

Generate 100 log lines into a .log file
```
$ python apache-fake-log-gen.py -n 100 -o LOG
$ python apache-fake-log-gen.py -n 100 -o LOG
```

Generate 100 log lines into a .gz file at intervals of 10 seconds
Expand All @@ -27,10 +27,10 @@ $ 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
$ python apache-fake-log-gen.py -n 0 -o LOG
```

Prefix the output filename
Prefix the output filename
```
$ python apache-fake-log-gen.py -n 100 -o LOG -p WEB1
```
Expand All @@ -57,6 +57,18 @@ optional arguments:
Sleep this long between lines (in seconds)
```

## Usage in Docker

Build the image:
```
docker build -t apache-fake-log-gen .
```

Run the application, and provide application command line arguments as Docker CMD args:
```
docker run --rm apache-fake-log-gen -n 10 -s 1
```
NOTE: `-o LOG` option does not work in this case.

## Requirements
* Python 2.7
Expand Down