akai-tsuki.hatenablog.com インストールした後に、設定してみました。
実際の設定です。
# cat /etc/logstash/conf.d/nginx-access_log.conf input { file { path => "/var/log/nginx/access.log" } } output { stdout { codec => "line" } } #
abコマンド実行
以下のようにアクセスします。
# ab -c 1 -n 1 http://localhost/
Nginxのログ
以下のように出力されます。
127.0.0.1 - - [01/Jul/2016:07:12:58 +0000] "GET / HTTP/1.0" 200 612 "-" "ApacheBench/2.3" "-"
Logstashの出力
# bin/logstash -f /etc/logstash/conf.d/nginx-access_log.conf Settings: Default pipeline workers: 1 Pipeline main started 2016-07-01T07:12:58.924Z e0b8c7a1e2cb 127.0.0.1 - - [01/Jul/2016:07:12:58 +0000] "GET / HTTP/1.0" 200 612 "-" "ApacheBench/2.3" "-"