I am working on building a monitoring system for our NGINX Plus servers, we are running these on Kubernetes. By default, NGINX Plus comes with API to get stats but they don't go into specific codes they get aggregated like 1XX, 2xx I am looking to get metrics for specific codes like 200, 301, 302, 404, and the only way I could find is to parse NGINX log files using tools like telegraf, but the problem is by default NGINX stream logs using STDOUT and STDERR, and telegraf cant really capture logs from streams and storing logs on the container doesn't make sense as it will not get picked by fluent-bit.
I am running NGINX and telegraf in the same pod, K8s has shareProcessNamespace which allows accessing container file systems in the same pod but NGINX is not really writing these logs to file its streaming.
is there any way I can parse logs and also stream logs to the docker demon?