Skip to content

Instantly share code, notes, and snippets.

@tuki0918
Created November 24, 2014 14:36
Show Gist options
  • Save tuki0918/673f65197604453a55ef to your computer and use it in GitHub Desktop.
Save tuki0918/673f65197604453a55ef to your computer and use it in GitHub Desktop.
Fluentd: apache.log | fluent-plugin-geoip
<source>
type tail
format apache
path /var/log/httpd/access_log
pos_file /var/log/td-agent/access_log.pos
tag geo.apache.log
</source>
<match geo.apache.log>
type geoip
geoip_lookup_key host
<record>
country ${country_code['host']}
coordinate [${longitude['host']},${latitude['host']}]
</record>
remove_tag_prefix geo.
</match>
<match apache.log>
type elasticsearch
host localhost
port 9200
index_name apache
type_name apache_log
include_tag_key true
tag_key @log_name
logstash_format true
time_format %Y-%m-%d %H:%M:%S
</match>
@tuki0918
Copy link
Author

sudo yum install geoip-devel —enablerepo=epel
sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-geoip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment