Telegraf is not reading Nginx access log file data.
Below is the Telegraf plugin configuration.
[[inputs.tail]]
files = ["/var/log/nginx/access.log"]
from_beginning = false
grok_patterns = ["%{IP:client_ip} .* %{CUSTOM_TIMESTAMP:timestamp:ts-httpd} %{NOTSPACE:method:tag} %{NOTSPACE:request_path:tag} .* %{NOTSPACE:country:tag} %{NUMBER:response_code:tag} %{NUMBER:resp_bytes:int} .* %{IP:http_x_forwarded_for} .* rt=%{NUMBER:request_time} .*"]
grok_custom_patterns = ‘’’
CUSTOM_TIMESTAMP %{MONTHDAY}/%{MONTH}/%{YEAR}:%{HOUR}:%{MINUTE}:%{SECOND} %{CUSTOM_TZ}
CUSTOM_TZ [±][0-9]{4}
‘’’
data_format = “grok”
Below is the Nginx access log format.
202.164.53.178 - - [22/Dec/2021:11:34:08 +0530] “GET / HTTP/1.1” 200 15 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36” “-” “3.7.231.59” sn=“10.30.20.131” rt=0.002 ua=“10.30.10.109:8082” us=“200” ut=“0.004” ul=“15” cs=-
Below is the Telegraf debug log
2021-12-22T08:59:48Z D! [agent] Attempting connection to [outputs.influxdb]
2021-12-22T08:59:48Z D! [agent] Successfully connected to outputs.influxdb
2021-12-22T08:59:48Z D! [agent] Starting service inputs
2021-12-22T08:59:48Z D! [inputs.tail] Tail added for “/var/log/nginx/access.log”
2021-12-22T08:59:58Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-12-22T09:00:08Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics
2021-12-22T09:00:18Z D! [outputs.influxdb] Buffer fullness: 0 / 10000 metrics