A standalone tool to transform a Varnish output file into a simple diagram sequence.
PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
images
kint @ 1368541
.gitmodules
LICENSE.txt
README.md
Transaction.class.php
VarnishlogParser.class.php
client.php

README.md

Varnishlog Parser

Software License Maintenance

A standalone tool to transform a Varnish output file into a simple diagram sequence.

Screenshot

Requirements

  • Varnish 4.1
  • PHP 5 (tested with PHP 5.6) or PHP 7.0
  • cURL (sudo apt-get install php5-curl or php-curl)
  • 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
  • cd 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.log file 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.

Contributing

Feel free to submit pull requests. The code is documented, but the logic is still complex (because Varnishlog is).

Known bugs

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 max_execution_time and upload_max_filesize in php.ini to fix that.

Todo

  • Set apart different clients (by IP)
  • Set apart different backends (by backend name or IP)
  • Parse and graph cookies
  • Add timestamps
  • Complete documentation

License

See the LICENSE file for license rights and limitations (MIT).

Thanks

Special thanks to :