Collecting metrics with [[inputs.logparser]] no output on test

influxdb
telegraf
#1

Hi,

Collect Metrics with [[inputs.logparser]] and [[inputs.nginx]] in order to have a better view about NG|NX but need some recommendations in order to have a complete Dashboard.
I’ve noticed on internet many approaches also some Dashboards ready to test on Grafana.com.
I’ve tested and tried some of them and after this I was starting from 0 a Dashboard to monitor the “Nginx” open source edition and to collect all the relevant metrics from it.
I use the nginx in order to centralize a page for acces on: kibana, grafana, jenkins, etc, not for big traffic let’s say.
My main problem is that I didn’t solved and tried all possible scenarios to obtain also the Result Code/ Status Code for HTTP.1XX,… and other metrics related to nginx not using [[inputs.nginx]] and using [[inputs.logparser]] and for this I need the good practices or maybe a little guidance if possible.
It will be developed [[inputs.nginx]] for open source solution to collect more metrics in future?

1). NG|NX -> OK

–nginx–

$ nginx -V 2>&1 | grep -o with-http_stub_status_module
with-http_stub_status_module

$ cat /etc/nginx/nginx.conf
server {
.
.
.
location /nginx_status {
#Enable Nginx stats
stub_status on;
}
}

–Telegraf–

telegraf-1.5.3-1.x86_64

–telegraf.conf–

[[inputs.nginx]]
urls = [“https://localhost/nginx_status”]
insecure_skip_verify = true
response_timeout = “5s”

–metrics & output–

  • Plugin: inputs.nginx, Collection 1

nginx,port=443,host=server1,server=localhost reading=0i,writing=1i,waiting=1i,active=2i,accepts=28760i,handled=28760i,requests=21563i 1522263195000000000

[root@server1 ~]# curl -k https://localhost/nginx_status
Active connections: 2
server accepts handled requests
28817 28817 21581
Reading: 0 Writing: 1 Waiting: 1

2). Logparser [[inputs.logparser]] -> NOK

All OK regarding metrics but if I want to get also the HTTP.1XX, HTTP.2XX… codes and other metrics what approach will be the best, I’m a little confused based on what I’ve found on internet, because I’ve already tested and not worked as supposed.
Example: https://grafana.com/dashboards/5063 for me this implementation didn’t worked.
https://github.com/influxdata/telegraf/issues/3484 (this article it has some good points in it).

–telegraf.conf–
(What approach will be the best for monitoring the nginx logs: /var/log/nginx/error.log, /var/log/nginx/access.log or only the /var/log/nginx/access.log)

[[inputs.logparser]]
files = ["/var/log/apache/access.log"]
from_beginning = true
watch_method = “inotify”
[inputs.logparser.grok]
## Other common built-in patterns are:
## %{COMMON_LOG_FORMAT} (plain apache & nginx access logs)
## %{COMBINED_LOG_FORMAT} (access logs + referrer & agent)
patterns = ["%{COMBINED_LOG_FORMAT}"]
measurement = “apache_access_log”
custom_pattern_files = []
custom_patterns = ‘’’
timezone = “Canada/Eastern”

Kind Regards,