Skip to content

Instantly share code, notes, and snippets.

@matsumana
Created November 15, 2012 11:18
Show Gist options
  • Save matsumana/4078096 to your computer and use it in GitHub Desktop.
Save matsumana/4078096 to your computer and use it in GitHub Desktop.
Fluentdの集約サーバ用設定ファイル (fluent-plugin-rewrite-tag-filter版)
<source>
type forward
</source>
<match apache.access.**>
type rewrite_tag_filter
capitalize_regex_backreference yes
rewriterule1 path \.(gif|jpe?g|png|ico|css|js)$ ignore
rewriterule2 path ^/$ rewrited.apache.access.top
rewriterule3 path ^\/([^\/]+) rewrited.apache.access.$1
rewriterule4 path .* rewrited.apache.access.others #fallback
</match>
<match rewrited.apache.access.**>
type copy
<store>
type forest
subtype numeric_counter
remove_prefix rewrited.apache.access
<template>
tag response.apache.access.__TAG__
aggregate tag
count_key response
pattern1 -10ms 0 10000
pattern2 -100ms 10000 100000
pattern3 -1s 100000 1000000
pattern4 -3s 1000000 3000000
pattern5 3s- 3000000
</template>
</store>
<store>
type forest
subtype datacounter
remove_prefix rewrited.apache.access
<template>
tag_prefix status.apache.access
unit minute
output_per_tag yes
aggregate tag
output_messages yes
count_key status
pattern1 2xx ^2\d\d
pattern2 3xx ^3\d\d
pattern3 429 ^429
pattern4 4xx ^4\d\d
pattern5 5xx ^5\d\d
</template>
</store>
</match>
<match response.apache.access.**>
type growthforecast
gfapi_url http://gf:5125/api/
remove_prefix response.apache.access
service response_time
tag_for section
name_key_pattern .*_percentage$
</match>
<match status.apache.access.**>
type growthforecast
gfapi_url http://gf:5125/api/
remove_prefix status.apache.access
service http_status
section status
tag_for section
name_key_pattern .*_count$
</match>
<match ignore>
type null
</match>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment