Skip to content

Instantly share code, notes, and snippets.

@tanan
Created December 4, 2018 03:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanan/88f9ad129ba80fffd0f3169c6adf78b3 to your computer and use it in GitHub Desktop.
Save tanan/88f9ad129ba80fffd0f3169c6adf78b3 to your computer and use it in GitHub Desktop.
<match nginx.access>
@type bigquery
method insert
auth_method json_key
json_key /etc/td-agent/bq-key.json
project {{ project }}
dataset {{ dataset }}
table {{ table }}
auto_create_table true
<inject>
time_key time
time_type string
time_format %Y-%m-%d %H:%M:%S
</inject>
schema [
{ "name": "time", "type": "TIMESTAMP" },
{ "name": "host", "type": "STRING" },
{ "name": "user", "type": "STRING" },
{ "name": "method", "type": "STRING" },
{ "name": "path", "type": "STRING" },
{ "name": "code", "type": "STRING" },
{ "name": "size", "type": "STRING" },
{ "name": "referer", "type": "STRING" },
{ "name": "agent", "type": "STRING" },
{ "name": "x_forwarded_for", "type": "STRING" },
{ "name": "resp", "type": "STRING" }
]
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment