Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # Fluentd ### Nginx log Format 수정 <code> 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; </code> ### Fluentd log Format <code> <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> </code> <code> 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 </code> ## Ref - https://github.com/fluent/fluentd - http://hongsa.github.io/fluentd/ - https://github.com/justinbuzzni/fluentd-elastic-kibana/blob/master/fluentd/conf/fluent.conf open/fluentd.txt Last modified: 2024/10/05 06:15by 127.0.0.1