NGINX Ingress Controller

Configure NGINX Ingress Controller Log Source with BindPlane

356

Supported Versions

NGINX Ingress Controller versions 1.7.0 and greater

Configuration

OptionDescription
Log SourceUse this field to specify where your logs are coming from. Defaults to 'Kubernetes', the only option available for NGINX ingress controller.
Log FormatSpecify the format for your NGINX Ingress controller logs. With 'Default' option, observIQ expects logs to be in the default NGINX format. With the observIQ option, observIQ expects logs to be formatted in an optimized JSON format. See Log Formats below.
Pod NameThe Pod or Pods running the NGINX ingress controller.
Container NameThe Containers running NGINX ingress. Typically, you can leave this as the default value of (*) and specify the Pod above.
Cluster NameFriendly name for the Kubernetes Cluster where the NGINX ingress controller is running. Is added to each log message as a Resource Label
Access LogsUse this field to verify the path to the Access log file and adjust default as needed (/var/log/nginx/access.log*).
Error LogsUse this field to verify the path to the Error log file and adjust default as needed (/var/log/nginx/error.log*).
Start AtChoose whether to start reading from the beginning or end of a file with "end" being the default.

Log Formats

Default: If you're using the default logging configuration for your NGINX Ingress Controller, choose the default Log Format option in the Source configuration.

observIQ: For optimal NGINX ingress controller parsing and enrichment, we recommend choosing the 'observIQ' log format, and updating your nginx.conf file using the below steps:

  1. Edit your NGINX Ingress configmap
  2. Add the log format to the configmap
  3. NGINX Ingress will automatically reload once the configmap is updated
log_format observiq
log-format-upstream: '{"remote_addr":"$remote_addr","remote_user":"$remote_user","time_local":"$time_local","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","http_referer":"$http_referer","http_user_agent":"$http_user_agent","request_length":"$request_length","request_time":"$request_time","proxy_upstream_name":"$proxy_upstream_name","proxy_alternative_upstream_name":"$proxy_alternative_upstream_name","upstream_addr":"$upstream_addr","upstream_response_length":"$upstream_response_length","upstream_response_time":"$upstream_response_time","upstream_status":"$upstream_status","request_id":"$req_id","proxy_add_x_forwarded_for":"$proxy_add_x_forwarded_for","bytes_sent":"$bytes_sent","time_iso8601":"$time_iso8601","upstream_connect_time":"$upstream_connect_time","upstream_header_time":"$upstream_header_time","namespace":"$namespace","ingress_name":"$ingress_name","service_name":"$service_name","service_port":"$service_port","http_x_forwarded_for":"$http_x_forwarded_for"}'

Example config map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-load-balancer-conf
  namespace: ingress-nginx
data:
log-format-upstream: '{"remote_addr":"$remote_addr","remote_user":"$remote_user","time_local":"$time_local","request":"$request","status":"$status","body_bytes_sent":"$body_bytes_sent","http_referer":"$http_referer","http_user_agent":"$http_user_agent","request_length":"$request_length","request_time":"$request_time","proxy_upstream_name":"$proxy_upstream_name","proxy_alternative_upstream_name":"$proxy_alternative_upstream_name","upstream_addr":"$upstream_addr","upstream_response_length":"$upstream_response_length","upstream_response_time":"$upstream_response_time","upstream_status":"$upstream_status","request_id":"$req_id","proxy_add_x_forwarded_for":"$proxy_add_x_forwarded_for","bytes_sent":"$bytes_sent","time_iso8601":"$time_iso8601","upstream_connect_time":"$upstream_connect_time","upstream_header_time":"$upstream_header_time","namespace":"$namespace","ingress_name":"$ingress_name","service_name":"$service_name","service_port":"$service_port","http_x_forwarded_for":"$http_x_forwarded_for"}'

Log Types

Types
nginx.ingress.access
nginx.ingress.error
nginx.ingress.controller

Advanced

For more information on the advanced configuration capabilities, see our detailed plugin guide here.