LoginSignup
0

More than 5 years have passed since last update.

mackerel-plugin-accesslog の Apache 2.2 用 LTSVログ設定

Last updated at Posted at 2018-12-23

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0