Created
November 24, 2014 14:36
-
-
Save tuki0918/673f65197604453a55ef to your computer and use it in GitHub Desktop.
Fluentd: apache.log | fluent-plugin-geoip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo yum install geoip-devel —enablerepo=epel
sudo /usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-geoip