文件操作 - web_log.conf
返回文件管理
返回主菜单
删除本文件
文件: /opt/netdata/usr/lib/netdata/conf.d/go.d/web_log.conf
编辑文件内容
# netdata go.d.plugin configuration for web_log # # This file is in YaML format. Generally the format is: # # name: value # # There are 2 sections: # - GLOBAL # - JOBS # # # [ GLOBAL ] # These variables set the defaults for all JOBs, however each JOB may define its own, overriding the defaults. # # The GLOBAL section format: # param1: value1 # param2: value2 # # Currently supported global parameters: # - update_every # Data collection frequency in seconds. Default: 1. # # - autodetection_retry # Re-check interval in seconds. Attempts to start the job are made once every interval. # Zero means not to schedule re-check. Default: 0. # # - priority # Priority is the relative priority of the charts as rendered on the web page, # lower numbers make the charts appear before the ones with higher numbers. Default: 70000. # # # [ JOBS ] # JOBS allow you to collect values from multiple sources. # Each source will have its own set of charts. # # IMPORTANT: # - Parameter 'name' is mandatory. # - Jobs with the same name are mutually exclusive. Only one of them will be allowed running at any time. # # This allows auto detection to try several alternatives and pick the one that works. # Any number of jobs is supported. # # The JOBS section format: # # jobs: # - name: job1 # param1: value1 # param2: value2 # # - name: job2 # param1: value1 # param2: value2 # # - name: job2 # param1: value1 # # # [ List of JOB specific parameters ]: # - path # The path to web server log file, can use wildcard. # Syntax: # path: /path/to/log/file # path: /path/to/log/*.log # # - exclude_path # The path to be excluded, can use wildcard. # Syntax: # exclude_path: *.tar.gz # # - url_patterns # Requests per URL pattern chart. Matches against URL field. # Matcher pattern syntax: https://github.com/netdata/go.d.plugin/tree/master/pkg/matcher#supported-format # Syntax: # url_patterns: # - name: name1 # Name will be used as dimension. # match: pattern # Pattern syntax: matcher. # - name: name2 # match: pattern # # - custom_fields # Requests per pattern charts. Matches against <custom> fields. Used in custom log format. # Matcher pattern syntax: https://github.com/netdata/go.d.plugin/tree/master/pkg/matcher#supported-format # Syntax: # custom_fields: # - name: field_name1 # Field name. Should match field name from log format. # patterns: # - name: name1 # Name will be used as dimension. # match: pattern # Pattern syntax: matcher. # - name: name2 # match: pattern # - name: field_name2 # patterns: # - name: name1 # match: pattern # - name: name2 # match: pattern # # - histogram # Cumulative histogram of response time in milli seconds. # Syntax: # histogram: [1,3,10,30,100] # # - group_response_codes # Group response codes by code class (informational, successful, redirects, client and server errors). # Syntax: # group_response_codes: yes/no # # - log_type # One of supported log types: csv, ltsv, regexp, auto. # If set to auto module will try to auto-detect log type and format. # Auto-detection order: ltsv, csv. # Syntax: # log_type: auto/csv/ltsv/regexp # # - csv_config # CSV log type specific parameters. # Syntax: # csv_config: # format: 'format' # Defines log format. You need define nginx or apache log format. # Nginx: http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format # Apache: http://httpd.apache.org/docs/current/mod/mod_log_config.html # fields_per_record: -1 # The number of expected fields per record. If set to positive, csv parser requires # each record to have the given number of fields. If set to 0, csv parser sets it to # the number of fields in the first record, so that future records must have the same # field count. If fields_per_record is negative, no check is made and records may have # a variable number of fields. # delimiter: ' ' # Field delimiter. # trim_leading_space: yes/no # If set to true, leading white space in a field is ignored. # # - ltsv_config # LTSV log type specific parameters. # Syntax: # ltsv_config: # field_delimiter: ' ' # Fields delimiter. # value_delimiter: ':' # Label-value pairs delimiter. # mapping: # Label field mapping. # label1: field1 # label2: field2 # # - regexp_config # RegExp log type specific parameters. # Pattern syntax: https://golang.org/pkg/regexp/syntax/. # Syntax: # regexp_config: # pattern: pattern # Pattern. It is mandatory to have subexpressions names in the pattern. # # # [ JOB defaults ]: # exclude_path: *.gz # group_response_codes: yes # log_type: auto # csv_config: # fields_per_record: -1 # delimiter: ' ' # trim_leading_space: no # ltsv_config: # field_delimiter: ' ' # value_delimiter: ':' # # # [ JOB mandatory parameters ]: # - name # - path # # ------------------------------------------------MODULE-CONFIGURATION-------------------------------------------------- # [ GLOBAL ] # update_every: 1 # autodetection_retry: 0 # priority: 70000 # # # [ JOBS ] jobs: # NGINX # debian, arch - name: nginx path: /var/log/nginx/access.log # gentoo - name: nginx path: /var/log/nginx/localhost.access_log # APACHE # debian - name: apache path: /var/log/apache2/access.log # gentoo - name: apache path: /var/log/apache2/access_log # arch - name: apache path: /var/log/httpd/access_log # debian - name: apache_vhosts path: /var/log/apache2/other_vhosts_access.log # GUNICORN - name: gunicorn path: /var/log/gunicorn/access.log - name: gunicorn path: /var/log/gunicorn/gunicorn-access.log
修改文件时间
将文件时间修改为当前时间的前一年
删除文件