Flog is a log generator commonly used for testing and benchmarking web server log analysis tools. It generates fake log data that mimics real-world logs such as Apache, RFC5424, Common Log Format, and other. The primary use of Flog is to generate log data without needing access to real logs, which might contain sensitive data. This tutorial explains how to install Flog log generator on Ubuntu 24.04.
Install Flog
Fetch the latest release version of Flog from the official GitHub repository:
FLOG_VERSION=$(curl -s "https://api.github.com/repos/mingrammer/flog/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
Then download the appropriate precompiled binary using the version we just retrieved:
wget -qO flog.tar.gz https://github.com/mingrammer/flog/releases/latest/download/flog_${FLOG_VERSION}_linux_amd64.tar.gz
Next, extract the flog
binary into /usr/local/bin
:
sudo tar xf flog.tar.gz -C /usr/local/bin flog
Verify that the Flog was installed correctly by checking its version:
flog --version
Finally, remove the downloaded archive file to keep the workspace tidy:
rm -rf flog.tar.gz
Testing Flog
Now let's generate some fake logs to see the Flog in action:
flog -n 100 -f apache_common -t log -o apache.log
This command generates 100 lines of fake Apache Common Log Format entries and saves them to apache.log
file.
Output example:
156.235.161.82 - veum2420 [24/Jul/2025:07:50:17 +0000] "GET /synthesize/strategize/productize/e-enable HTTP/2.0" 503 21914
210.53.179.157 - - [24/Jul/2025:07:50:17 +0000] "PUT /infrastructures/cross-platform/recontextualize HTTP/2.0" 404 4491
248.131.206.254 - gutkowski8761 [24/Jul/2025:07:50:17 +0000] "PUT /implement/synergistic HTTP/1.0" 200 29950
86.200.179.183 - kunde7568 [24/Jul/2025:07:50:17 +0000] "DELETE /partnerships HTTP/1.1" 203 26729
...
Uninstall Flog
If you no longer need Flog, you can remove it from the system with the following command:
sudo rm -rf /usr/local/bin/flog
Leave a Comment
Cancel reply