A standalone tool to transform a Varnish output file into a simple diagram sequence.
- Varnish 4.1
- PHP 5 (tested with PHP 5.6) or PHP 7.0
- cURL (
sudo apt-get install php5-curlor
- Internet access to websequencediagrams.com (generated diagram)
Installation and usage
First, you need to generate a varnishlog output.
- Log in your Varnish server
- Execute this command:
varnishlog -g raw > /tmp/output.log
- Navigate on your website for few seconds, then kill varnishlog with Ctrl+C
- Get the output file on your computer
Then, install this tool:
git clone https://github.com/TOMHTML/varnishlog-parser.git varnishlog-parser
git submodule update --init, to download the Kint library
Finally, execute the web client as a standalone tool:
php -S 127.0.0.1:8080 client.php
- Go to http://127.0.0.1:8080/
- Enter the local path to your
output.logfile in the first form, or upload the file
- Have fun!
Feel free to install Varnishlog Parser on a private web server like Apache or Nginx.
Feel free to submit pull requests. The code is documented, but the logic is still complex (because Varnishlog is).
This is a week-end project, home alone, so it's not fully tested and there is obviously a handful of hidden bugs. Nevertheless, main unusual use cases have been tested (ESI, restarts, truncated file, synth responses, custom vmods, background fetches...).
- In some edge cases, transactions order might not be fully respected.
- Very big files might cause timeout errors. Increase the value of
php.inito fix that.
- Set apart different clients (by IP)
- Set apart different backends (by backend name or IP)
- Parse and graph cookies
- Add timestamps
- Complete documentation
See the LICENSE file for license rights and limitations (MIT).
Special thanks to :