This tool allows to read ElasticSearch slowlog records and produce output using text/template format.
It is mainly intended as helper tool for slowlog analysis and to produce input data for load testing tools.
There is predefined output formats for:
- Vegeta (use patched version until tsenart/vegeta#148 is closed)
- Yandex Tank
go get github.com/coxx/es-slowlog/cmd/es-slowlog-parse
Write all queries to standard output
cat *_search_slowlog.log | es-slowlog-parse
Convert slowlog to tab-separated file
cat *_search_slowlog.log | es-slowlog-parse -f '{{.Index}}\t{{.Types}}\t{{.SearchType}}\t{{.Source}}'
Produce vegeta target file
cat *_search_slowlog.log | es-slowlog-parse -f vegeta -a localhost:9200
- Parser and scanner inspired by Rob Pike's talk Lexical Scanning in Go. I'm pretty sure all this code can be replaced by couple of regular expressions but then it was not so cool.
- Directory structure inspired by Mat Ryer's post 5 simple tips and tricks for writing unit tests in #golang.