Skip to content

Instantly share code, notes, and snippets.

@oranie
oranie / DataCounterOutput.josn
Created February 23, 2012 05:50
DataCounterOutput sample
2012-02-23T14:25:41+09:00 result {
"apache.error_unmatched_count":0,
"apache.error_unmatched_rate":0.0,
"apache.error_unmatched_percentage":0.0,
"apache.error_2xx_count":0,
"apache.error_2xx_rate":0.0,
"apache.error_2xx_percentage":0.0,
"apache.error_3xx_count":0,
"apache.error_3xx_rate":0.0,
"apache.error_3xx_percentage":0.0,
@oranie
oranie / apache_fluent.conf
Created February 23, 2012 05:56
apache_fluent.conf
<source>
type tail
format /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/httpd/access_log_sym
tag apache.access
pos_file /var/tmp/access.log.pos
</source>
<source>
@oranie
oranie / td-agent.conf
Created February 23, 2012 05:56
td-agent.conf
<source>
type tcp
</source>
#<match apache.access>
# type file
# path /var/log/td-agent/access_log
#</match>
#<match apache.error>
@oranie
oranie / conf_app.psgi
Created March 12, 2012 08:07
conf_app.psgi
my $app = sub {
my $env = shift;
my $body = <<"EOF";
<source>
type tail
format \/^(?<XFF-host>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$\/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/httpd/access_log_sym
tag apache.access.$env->{REMOTE_ADDR}
pos_file /var/tmp/access.log.pos
@oranie
oranie / result
Created March 12, 2012 08:19
result
# curl http://127.0.0.1:5000/
<source>
type tail
format /^(?<XFF-host>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) [(?<time>[^]]*)] "(?<method>S+)(?: +(?<path>[^ ]*) +S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^"]*)" "(?<agent>[^"]*)" (?<response_time>[^ ]*))?/
time_format %d/%b/%Y:%H:%M:%S %z
path /var/log/httpd/access_log_sym
tag apache.access.127.0.0.1
pos_file /var/tmp/access.log.pos
</source>
@oranie
oranie / psgi_fluent_format
Created March 12, 2012 15:16
psgi_fluent_format
format \/^(?<XFF-host>[^ ]*) (?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \\[(?<time>[^\\]]*)\\] "(?<method>\\S+)(?: +(?<path>[^ ]*) +\\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\\"]*)" "(?<agent>[^\\"]*)" (?<response_time>[^ ]*))?\$\/
@oranie
oranie / fluentd_apache_log
Created March 12, 2012 15:19
fluentd_apache_log
2012-03-12T19:53:04+09:00 apache.access.127.0.0.1 {"XFF-host":"-","host":"213.155.28.136","user":"-","method":"GET","path":"//phpMyAdmin-2.5.7/index.php","status":"404","size":"224","referer":"-","agent":"-","response_time":"439"}
2012-03-12T19:53:05+09:00 apache.access.127.0.0.1 {"XFF-host":"-","host":"213.155.28.136","user":"-","method":"GET","path":"//phpMyAdmin-2.5.7-pl1/index.php","status":"404","size":"228","referer":"-","agent":"-","response_time":"736"}
2012-03-12T22:53:40+09:00 apache.access.127.0.0.1 {"XFF-host":"-","host":"200.55.199.235","user":"-","method":"GET","path":"/","status":"200","size":"194","referer":"-","agent":"Python-urllib/2.4","response_time":"3027"}
2012-03-12T23:38:08+09:00 apache.access.127.0.0.1 {"XFF-host":"-","host":"184.82.117.46","user":"-","method":"GET","path":"http://nixapi.com/my-http-headers","status":"404","size":"213","referer":"-","agent":"NiX API - http://nixapi.com/","response_time":"1159"}
@oranie
oranie / error
Created March 14, 2012 06:39
src.rpm error
make: *** [install] Error 1
エラー: Bad exit status from /var/tmp/rpm-tmp.91246 (%install)
RPM build errors:
user build does not exist - using root
group build does not exist - using root
user build does not exist - using root
group build does not exist - using root
user build does not exist - using root
@oranie
oranie / apache_fluentd_config
Created March 16, 2012 15:27
apache fluentd config
<match apache.access.**>
type copy
<store>
compress gzip
type file
path /var/log/td-agent/access_log
</store>
<store>
type datacounter
@oranie
oranie / apache_fluentd_config
Created March 16, 2012 15:28
apache fluentd config
<match apache.access.**>
type copy
<store>
compress gzip
type file
path /var/log/td-agent/access_log
</store>
<store>
type datacounter