- fluentd or td-agent version: fluentd-0.12.31
- Environment information, e.g. OS.: efk stack in docker containers (
https://github.com/kazu69/docker-efk)
- Your configuration:
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<filter nginx.docker.**>
@type parser
format /^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)
(?: +(?<path>[^\"]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agen
t>[^\"]*)")?$/
time_format %Y-%m-%dT%H:%M:%S.%L%Z
key_name log
reserve_data true
</filter>
<match nginx.docker.*>
@type elasticsearch
host 172.17.0.1
port 9200
logstash_format true
flush_interval 5s
</match>
- Your problem explanation. If you have an error logs, write it together.
I'm unable to extract or parse data from the log row in my table in Kibana 5.
The official fluentd nginx regex:
format /^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$/
time_format %d/%b/%Y:%H:%M:%S %z
My error log:
2017/01/07 20:19:00 [error] 7#7: *1 open() "/usr/share/nginx/html/88888" failed (2: No such file or directory), client: 192.168.28.1, server: localhost, request: "GET /88888 HTTP/1.1", host: "
192.168.28.133:8080"
When I generate an error with nginx, fluentd reports:
2017-01-07 20:48:45 +0000 [warn]: pattern not match with data '192.168.2
8.1 - - [07/Jan/2017:20:48:45 +0000] "GET /88888 HTTP/1.1" 404 169 "-" "Mozilla/5.0 (Windows N
T 10.0; Win64; x64; rv:50.0) Gecko/20100101 Firefox/50.0" "-"'