11package main
22
3- const CONFIG_TOML = `# Top Ranking Group By Request
3+ const CONFIG_TOML = `################################################################################
4+ # General
5+ ################################################################################
6+
7+ # Top Ranking Group By Request
48ranking_count = 20
59
610# Top Slow Requests
@@ -18,6 +22,10 @@ show_bytes = true
1822# Percentiles
1923percentiles = [ 50.0, 90.0, 95.0, 99.0 ]
2024
25+ ################################################################################
26+ # Scale
27+ ################################################################################
28+
2129# for Nginx($request_time)
2230scale = 0
2331effective_digit = 3
@@ -26,59 +34,91 @@ effective_digit = 3
2634#scale = -6
2735#effective_digit = 6
2836
37+ # for H2O(%{duration}x)
38+ #scale = 0
39+ #effective_digit = 6
40+
41+ # for Envoy
42+ #scale = -3
43+ #effective_digit = 3
44+
2945# for Rack(Rack::CommonLogger)
3046#scale = 0
3147#effective_digit = 4
3248
49+ ################################################################################
50+ # Parse
51+ ################################################################################
3352
53+ #
3454# combined + duration
3555# Nginx example: '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time'
3656# Apache example: "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %D"
3757# H2O example: "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\" %{duration}x"
3858# Varnishncsa example: '%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-agent}i" %D'
59+ #
3960log_format = '^([^ ]+) ([^ ]+) ([^ ]+) \[([^\]]+)\] "((?:\\"|[^"])*)" (\d+) (\d+|-) "((?:\\"|[^"])*)" "((?:\\"|[^"])*)" ([0-9.]+)$'
40-
4161request_index = 5
4262status_index = 6
4363bytes_index = 7
4464duration_index = 10
4565
66+ #
67+ # Envoy example: use default format
68+ #
69+ #log_format = '^\[([^\]]+)\] "((?:\\"|[^"])*)" (\d+) ([^ ]+) (\d+|-) (\d+|-) (\d+) (\d+) "((?:\\"|[^"])*)" "((?:\\"|[^"])*)" "((?:\\"|[^"])*)" "((?:\\"|[^"])*)" "((?:\\"|[^"])*)"'
70+ #request_index = 2
71+ #status_index = 3
72+ #bytes_index = 6
73+ #duration_index = 7
74+
75+ #
4676# Rack example: use Rack::CommonLogger, Logger.new("/tmp/app.log")
77+ #
4778#log_format = '^([^ ]+) ([^ ]+) ([^ ]+) \[([^\]]+)\] "((?:\\"|[^"])*)" (\d+) (\d+|-) ([0-9.]+)$'
4879#request_index = 5
4980#status_index = 6
5081#bytes_index = 7
5182#duration_index = 8
5283
84+ ################################################################################
85+ # Bundle
86+ ################################################################################
87+
88+ #
5389# You can aggregate requests by regular expression
5490# For overview of regexp syntax: https://golang.org/pkg/regexp/syntax/
55- [[bundle]]
56- regexp = '^(GET|HEAD) /memo/[0-9]+\b'
57- name = "get memo"
58-
59- [[bundle]]
60- regexp = '^(GET|HEAD) /stylesheets/'
61- name = "stylesheets"
91+ #
92+ #[[bundle]]
93+ #regexp = '^(GET|HEAD) /users/[0-9]+\b'
94+ #name = 'GET /memo/*'
95+ #
96+ #[[bundle]]
97+ #regexp = '^(GET|HEAD) /stylesheets/'
98+ #name = 'GET /stylesheets/*'
99+ #
100+ #[[bundle]]
101+ #regexp = '^(GET|HEAD) /images/'
102+ #name = 'GET /images/*'
62103
63- [[bundle]]
64- regexp = '^(GET|HEAD) /images/'
65- name = "images"
104+ ################################################################################
105+ # Replace
106+ ################################################################################
66107
108+ #
67109# You can replace the part of urls which matched to your regular expressions.
68110# For overview of regexp syntax: https://golang.org/pkg/regexp/syntax/
69- #[[replace]]
70- #regexp = '/[0-9]+/'
71- #replace = '/<num>/'
72111#
73112#[[replace]]
74- #regexp = '/[0-9]+\s '
75- #replace = '/<num> '
113+ #regexp = '/[0-9]+(/|\s) '
114+ #replace = '/<num>$1 '
76115#
77116#[[replace]]
78- #regexp = '=[0-9]+& '
79- #replace = '=<num>& '
117+ #regexp = '=[0-9]+(&|\s) '
118+ #replace = '=<num>$1 '
80119#
81120#[[replace]]
82- #regexp = '=[0-9]+\s'
83- #replace = '=<num> '
84- `
121+ #regexp = '\s+HTTP/[0-9.]+$'
122+ #replace = ''
123+
124+ ################################################################################`
0 commit comments