0

how can I write the regex for the following nginx access log format in fluentd ?

log_format main '$remote_addr - $remote_user [$time_local]  $request '
                        '"$status" $body_bytes_sent "$http_referer" '
                        '"$http_HOST" $HOST '
                        '"$http_user_agent" "$http_x_forwarded_for" '
                        'upstream_response_time $upstream_response_time '
                        'upstream_addr $upstream_addr '
                          'msec $msec request_time $request_time';
Saeed Zhiany
  • 2,051
  • 9
  • 30
  • 41
Ayman Al-Shorman
  • 190
  • 1
  • 2
  • 18

1 Answers1

-1

This is easy with nginx fluend module.

The module send access logs to fluentd via fluentd-udp-plugin realtime, the log format is json, you can get all log variables in fluentd.