Skip to content

Instantly share code, notes, and snippets.

@fukata
Created August 1, 2012 04:44
Show Gist options
  • Save fukata/3223740 to your computer and use it in GitHub Desktop.
Save fukata/3223740 to your computer and use it in GitHub Desktop.
agesage viewer query logs save td from fluentd
# agesage viewer
<source>
type tail
format /^q\:(?<query>.*), page\:(?<page>[0-9]+), slag\:(?<slag>[^ ]+), time\:(?<time_max>[0-9]*), sort\:(?<sort>[^ ]+), order\:(?<order>[^ ]+)$/
path /var/log/asg/query.log
tag agesage.queries
pos_file /var/log/td-agent/agesage.queries.pos
</source>
<match agesage.queries>
type copy
<store>
type tdlog
apikey ${発行したAPI KEY}
auto_create_table true
flush_interval 300s
use_ssl true
buffer_type file
buffer_path /var/log/td-agent/buffer/agesage_queries_td
</store>
<store>
type mongo
database asg
collection queries
host 127.0.0.1
port 27017
flush_interval 10s
buffer_type file
buffer_path /var/log/td-agent/buffer/agesage_queries_mongo
</store>
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment