web_log.conf 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. # netdata python.d.plugin configuration for web log
  2. #
  3. # This file is in YaML format. Generally the format is:
  4. #
  5. # name: value
  6. #
  7. # There are 2 sections:
  8. # - global variables
  9. # - one or more JOBS
  10. #
  11. # JOBS allow you to collect values from multiple sources.
  12. # Each source will have its own set of charts.
  13. #
  14. # JOB parameters have to be indented (using spaces only, example below).
  15. # ----------------------------------------------------------------------
  16. # Global Variables
  17. # These variables set the defaults for all JOBs, however each JOB
  18. # may define its own, overriding the defaults.
  19. # update_every sets the default data collection frequency.
  20. # If unset, the python.d.plugin default is used.
  21. # update_every: 1
  22. # priority controls the order of charts at the netdata dashboard.
  23. # Lower numbers move the charts towards the top of the page.
  24. # If unset, the default for python.d.plugin is used.
  25. # priority: 60000
  26. # penalty indicates whether to apply penalty to update_every in case of failures.
  27. # Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
  28. # penalty: yes
  29. # autodetection_retry sets the job re-check interval in seconds.
  30. # The job is not deleted if check fails.
  31. # Attempts to start the job are made once every autodetection_retry.
  32. # This feature is disabled by default.
  33. # autodetection_retry: 0
  34. # ----------------------------------------------------------------------
  35. # JOBS (data collection sources)
  36. #
  37. # The default JOBS share the same *name*. JOBS with the same name
  38. # are mutually exclusive. Only one of them will be allowed running at
  39. # any time. This allows autodetection to try several alternatives and
  40. # pick the one that works.
  41. #
  42. # Any number of jobs is supported.
  43. # ----------------------------------------------------------------------
  44. # PLUGIN CONFIGURATION
  45. #
  46. # All python.d.plugin JOBS (for all its modules) support a set of
  47. # predefined parameters. These are:
  48. #
  49. # job_name:
  50. # name: myname # the JOB's name as it will appear at the
  51. # # dashboard (by default is the job_name)
  52. # # JOBs sharing a name are mutually exclusive
  53. # update_every: 1 # the JOB's data collection frequency
  54. # priority: 60000 # the JOB's order on the dashboard
  55. # penalty: yes # the JOB's penalty
  56. # autodetection_retry: 0 # the JOB's re-check interval in seconds
  57. #
  58. # Additionally to the above, web_log also supports the following:
  59. #
  60. # path: 'PATH' # the path to web server log file
  61. # path: 'PATH[0-9]*[0-9]' # log files with date suffix are also supported
  62. # detailed_response_codes: yes/no # default: yes. Additional chart where response codes are not grouped
  63. # detailed_response_aggregate: yes/no # default: yes. Not aggregated detailed response codes charts
  64. # all_time : yes/no # default: yes. All time unique client IPs chart (50000 addresses ~ 400KB)
  65. # filter: # filter with regex
  66. # include: 'REGEX' # only those rows that matches the regex
  67. # exclude: 'REGEX' # all rows except those that matches the regex
  68. # categories: # requests per url chart configuration
  69. # cacti: 'cacti.*' # name(dimension): REGEX to match
  70. # observium: 'observium.*' # name(dimension): REGEX to match
  71. # stub_status: 'stub_status' # name(dimension): REGEX to match
  72. # user_defined: # requests per pattern in <user_defined> field (custom_log_format)
  73. # cacti: 'cacti.*' # name(dimension): REGEX to match
  74. # observium: 'observium.*' # name(dimension): REGEX to match
  75. # stub_status: 'stub_status' # name(dimension): REGEX to match
  76. # custom_log_format: # define a custom log format
  77. # pattern: '(?P<address>[\da-f.:]+) -.*?"(?P<method>[A-Z]+) (?P<url>.*?)" (?P<code>[1-9]\d{2}) (?P<bytes_sent>\d+) (?P<resp_length>\d+) (?P<resp_time>\d+\.\d+) '
  78. # time_multiplier: 1000000 # type <int>/<float> - convert time to microseconds
  79. # histogram: [1,3,10,30,100, ...] # type list of int - Cumulative histogram of response time in milli seconds
  80. # ----------------------------------------------------------------------
  81. # WEB SERVER CONFIGURATION
  82. #
  83. # Make sure the web server log directory and the web server log files
  84. # can be read by user 'netdata'.
  85. #
  86. # To enable the timings chart and the requests size dimension, the
  87. # web server needs to log them. This is how to add them:
  88. #
  89. # nginx:
  90. # log_format netdata '$remote_addr - $remote_user [$time_local] '
  91. # '"$request" $status $body_bytes_sent '
  92. # '$request_length $request_time $upstream_response_time '
  93. # '"$http_referer" "$http_user_agent"';
  94. # access_log /var/log/nginx/access.log netdata;
  95. #
  96. # apache (you need mod_logio enabled):
  97. # LogFormat "%h %l %u %t \"%r\" %>s %O %I %D \"%{Referer}i\" \"%{User-Agent}i\"" vhost_netdata
  98. # LogFormat "%h %l %u %t \"%r\" %>s %O %I %D \"%{Referer}i\" \"%{User-Agent}i\"" netdata
  99. # CustomLog "/var/log/apache2/access.log" netdata
  100. # ----------------------------------------------------------------------
  101. # VHOST AND PORT
  102. # if your want to graph the request/sec per virtual host and per port (to check the number of requests in http vs https)
  103. # in apache : (%v gives the hostname, %p the port number)
  104. # LogFormat "%v %p %h %t \"%r\" %>s %O %I %D \"%{Referer}i\" \"%{User-Agent}i\"" vhost_netdata
  105. #
  106. # and in this file in apache_vhosts_log section, add :
  107. # custom_log_format:
  108. # pattern: '(?P<vhost>[a-zA-Z\d.-_]+) (?P<port>\d+) (?P<address>[\da-f.:]+) \[.*\] "(?P<method>[A-Z]+)[^"]*" (?P<code>[1-9]\d{2}) (?P<bytes_sent>\d+) (?P<resp_length>\d+) (?P<resp_time>\d+)'
  109. # in nginx: ($host or $http_host give the hostname, $server_port the port number)
  110. # log_format netdatavhost '$host $server_port $remote_addr - $remote_user [$time_local] '
  111. # '"$request" $status $body_bytes_sent '
  112. # '$request_length $request_time $upstream_response_time '
  113. # '"$http_referer" "$http_user_agent"';
  114. #
  115. # access_log /var/log/nginx/access.log netdatavhost;
  116. #
  117. # be aware that the access_log directive in a server{} block overwrites the one in http{}, if your vhosts have individual log
  118. # files, you have to specify the general netdata log in each vhost as a second access_log statement.
  119. #
  120. # and in this file in nginx_log section, add :
  121. # custom_log_format:
  122. # pattern: '(?P<vhost>[a-zA-Z\d.-_\[\]]+) (?P<port>\d+) (?P<address>[\da-f.:]+) .* "(?P<method>[A-Z]+)[^"]*" (?P<code>[1-9]\d{2}) (?P<bytes_sent>\d+) (?P<resp_length>\d+) (?P<resp_time>\d+)'
  123. # ----------------------------------------------------------------------
  124. # AUTO-DETECTION JOBS
  125. # only one of them per web server will run (when they have the same name)
  126. # -------------------------------------------
  127. # nginx log on various distros
  128. # debian, arch
  129. nginx_log:
  130. name: 'nginx'
  131. path: '/var/log/nginx/access.log'
  132. # gentoo
  133. nginx_log2:
  134. name: 'nginx'
  135. path: '/var/log/nginx/localhost.access_log'
  136. # -------------------------------------------
  137. # apache log on various distros
  138. # debian
  139. apache_log:
  140. name: 'apache'
  141. path: '/var/log/apache2/access.log'
  142. # gentoo
  143. apache_log2:
  144. name: 'apache'
  145. path: '/var/log/apache2/access_log'
  146. # arch
  147. apache_log3:
  148. name: 'apache'
  149. path: '/var/log/httpd/access_log'
  150. # debian
  151. apache_vhosts_log:
  152. name: 'apache_vhosts'
  153. path: '/var/log/apache2/other_vhosts_access.log'
  154. # -------------------------------------------
  155. # gunicorn log on various distros
  156. gunicorn_log:
  157. name: 'gunicorn'
  158. path: '/var/log/gunicorn/access.log'
  159. gunicorn_log2:
  160. name: 'gunicorn'
  161. path: '/var/log/gunicorn/gunicorn-access.log'
  162. # -------------------------------------------
  163. # Apache Cache
  164. apache_cache:
  165. name: 'apache_cache'
  166. type: 'apache_cache'
  167. path: '/var/log/apache/cache.log'
  168. apache2_cache:
  169. name: 'apache_cache'
  170. type: 'apache_cache'
  171. path: '/var/log/apache2/cache.log'
  172. httpd_cache:
  173. name: 'apache_cache'
  174. type: 'apache_cache'
  175. path: '/var/log/httpd/cache.log'
  176. # -------------------------------------------
  177. # Squid
  178. # debian/ubuntu
  179. squid_log1:
  180. name: 'squid'
  181. type: 'squid'
  182. path: '/var/log/squid3/access.log'
  183. #gentoo
  184. squid_log2:
  185. name: 'squid'
  186. type: 'squid'
  187. path: '/var/log/squid/access.log'