Skip to content

Instantly share code, notes, and snippets.

Created November 9, 2018 00:02
What would you like to do?
# Example fluentd config file for nginx access log injection into Google Bigquery
# collecting nginx access log
@type tail
tag accesslogs-rickts-dev-box
path /var/log/nginx/access.log
format apache
buffer_type file
buffer_path /tmp/tdagent.rickts-dev-box
pos_file /var/log/td-agent/nginx.pos
# add servername
<filter accesslogs-rickts-dev-box>
@type record_transformer
hostname ${hostname}
# add vhost
<filter accesslogs-rickts-dev-box>
@type record_transformer
# forwarding to bigquery plugin
<match accesslogs-rickts-dev-box>
@type bigquery_insert
auth_method json_key
json_key /path/to/your/service/account/credentials.json
project "rickts-dev-project"
dataset nginxweblogs
tables nginxweblogtable
time_format %s
time_field time
fetch_schema true
field_integer time
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment