mackerel-plugin-accesslog
導入の覚書です。
プラグインインストール
yum install mackerel-agent-plugins
Apache LTSV ログフォーマット
cd /etc/httpd/conf.d
vi 00_ltsv_log.conf
LogFormat "vhost:%{Host}i\thttps:%{HTTPS}e\ttime:%t\tforwardedfor:%{X-Forwarded-For}i\thost:%h\tmethod:%m\tpath:%U%q\tprotocol:%H\tstatus:%>s\tsize:%B\treferer:%{Referer}i\tua:%{User-Agent}i\treqtime_microsec:%D\tcache:%{X-Cache}o\truntime:%{X-Runtime}o" apache_ltsv
ここにこれだと大丈夫という LogFormat を書いといてくれればよいなあ、、、
https://github.com/mackerelio/mackerel-agent-plugins/tree/master/mackerel-plugin-accesslog
参考:
https://mackerel.io/ja/blog/entry/advent-calendar2017/day9-mackerel-plugin-accesslog
https://twitter.com/hogem/status/1039798293742608385
http://ltsv.org/
time:%{%d/%b/%Y:%H:%M:%S %z}t
だとmackerel が受け付けてくれない? -> 大丈夫。
[] 無しでも大丈夫そう。
reqtime がないとダメ?
req もないとダメ?
マカレル設定
vi /etc/mackerel-agent/mackerel-agent.conf
[plugin.metrics.accesslog]
command = "mackerel-plugin-accesslog /var/log/httpd/access_ltsv.log"
service mackerel-agent configtest
service mackerel-agent reload