Instantly share code, notes, and snippets.

Embed
What would you like to do?
#
# Example fluentd config file for nginx access log injection into Google Bigquery
# collecting nginx access log
<source>
@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
</source>
# add servername
<filter accesslogs-rickts-dev-box>
@type record_transformer
<record>
hostname ${hostname}
</record>
</filter>
# add vhost
<filter accesslogs-rickts-dev-box>
@type record_transformer
<record>
vhost rickts-dev-box.fix8r.com
</record>
</filter>
# forwarding to bigquery plugin
<match accesslogs-rickts-dev-box>
@type bigquery_insert
auth_method json_key
email 0123456789123456-compute@developer.gserviceaccount.com
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
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment