機能追加 #674
履歴
#2 山本 義治 がほぼ9年前に更新
fluentd設定変更¶
[root@www14012uf admin]# vi /etc/td-agent/td-agent.conf
<source> type tail path /etc/httpd/logs/garoll.net-access_log tag apache.combined pos_file /var/log/td-agent/httpd-access.log.pos format /^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>.*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<status>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" (?<response_time>[^ ]*))?$/ time_format %d/%b/%Y:%H:%M:%S %z types size:integer,response_time:integer </source> <match apache.**> type copy <store> type stdout </store> <store> type forward buffer_chunk_limit 256m buffer_queue_limit 128 flush_interval 5s <server> host 49.212.214.23 port 24224 </server> </store> </match>
[root@www14012uf admin]# /etc/init.d/td-agent restart
[root@www14012uf admin]# tail -f /var/log/td-agent/td-agent.log
2016-02-17 20:17:10 +0900 apache.combined: {"host":"126.212.2.146","user":"-","method":"GET","path":"/ajax/feed_data.php?ptid=46&referer=http://syachisoku.com/news/6135","status":"200","size":42,"referer":"http://syachisoku.com/news/6135","agent":"Mozilla/5.0 (Linux; U; Android 4.1.2; ja-jp; 201M Build/9.8.2Q-34_SMJ-102) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30","response_time":12579} 2016-02-17 20:17:11 +0900 apache.combined: {"host":"157.55.39.67","user":"-","method":"GET","path":"/entry/395678","status":"200","size":29631,"referer":"-","agent":"Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)","response_time":718770} 2016-02-17 20:17:11 +0900 apache.combined: {"host":"68.180.228.215","user":"-","method":"GET","path":"/entry/352248","status":"200","size":39733,"referer":"-","agent":"Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)","response_time":558925} ...