open:fluentd

Fluentd

log_format format '$remote_addr $time_iso8601 $request_uri $request_length $request_time "$http_user_agent"';

access_log /var/log/nginx/access.log format;
error_log /var/log/nginx/error.log;

<source>
  type tail
  path /var/log/nginx/access.log #...or where you placed your Apache access log
  pos_file /var/log/td-agent/nginx-access.log.pos
  tag nginx.access #fluentd tag!
  time_format %d/%b/%Y:%H:%M:%S %z
  format /^(?<remote_addr>[^ ]*) - (?<remote_user>[^ ]*) \[(?<time>[^\]]*)\]\s+"(?<request_type>[^ ]*) (?<request_url>[^ ]*) (?<request_http_protocol>[^ ]*)" (?<status>[^"]*) (?<body_bytes_sent>[^ ]*) "(?<http_referer>[^"]*)" "(?<http_user_agent>[^"]*)" (?<request_time>[^ ]*)/
</source>

format /^(?<host>[^ ]*) (?<time>[^ ]*) (?<urlpath>[^ ]*) (?<size>[0-9]*) (?<duration>[0-9]*\.[0-9]*) "(?<agent>[^\"]*)"$/
    types host:string,time:time,urlpath:string,size:integer,duration:float,agent:string

  • open/fluentd.txt
  • 마지막으로 수정됨: 2021/03/30 00:21
  • 저자 127.0.0.1