<commit_before># Varnishlog Parser

A stand-alone tool to transform a varnishlog file into a nice diagram sequence.

![Screenshot](images/example_output.png)

## Requirements

 * Varnish 4.1
 * PHP 5 (tested with PHP 5.6)
 * Kink library (loaded as Git submodule)
 * 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 <this URL>` varnishlog-parser
 * `cd varnishlog-parser`
 * `git submodule init`
 * `git submodule update`

Finally, **execute** the web client:

 * `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
 * Have fun!

## 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 are obviously many hidden bugs. Nevertheless, main unusual use cases have been tested (ESI, restarts, truncated file, synth response, custom vmods, ...).

* The sequence diagram font size is too small when there are too many transactions.



## Todo

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

## Thanks

Special thanks to :

 * <NAME> and all the (Varnish Software)[https://www.varnish-software.com/] team
 * <NAME> for the [Vsltrans](http://vsltrans.varnish.jp/) project
 * Websequencediagrams.com and its nice (and free!) API
 * [Kint](http://raveren.github.io/kint/), `print_r()` on steroids
<commit_msg>Better introduction<commit_after># Varnishlog Parser

A stand-alone tool to transform a Varnish output file into a simple diagram sequence.

![Screenshot](images/example_output.png)

## Requirements

 * Varnish 4.1
 * PHP 5 (tested with PHP 5.6)
 * Kink library (loaded as Git submodule)
 * 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 <this URL>` varnishlog-parser
 * `cd varnishlog-parser`
 * `git submodule init`
 * `git submodule update`

Finally, **execute** the web client:

 * `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
 * Have fun!

## 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 are obviously many hidden bugs. Nevertheless, main unusual use cases have been tested (ESI, restarts, truncated file, synth response, custom vmods, ...).

* The sequence diagram font size is too small when there are too many transactions.
* In some edge cases, transactions order might not be fully respected.


## Todo

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

## Thanks

Special thanks to :

 * <NAME> and all the (Varnish Software)[https://www.varnish-software.com/] team
 * <NAME> for the [Vsltrans](http://vsltrans.varnish.jp/) project
 * Websequencediagrams.com and its nice (and free!) API
 * [Kint](http://raveren.github.io/kint/), `print_r()` on steroids

{'fraction_non_alphanumeric': 0.10035750766087845, 'fraction_numerical': 0.012768130745658836, 'mean_word_length': 4.106910039113429, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1477988', 'n_tokens_mistral': 1247, 'n_tokens_neox': 1174, 'n_words': 503}