Configure monitor inputs for the Splunk Add-on for NGINX
Install and configure a forwarder on your NGINX server to monitor the access and error log files generated by the NGINX server. You can use either Splunk Web to create the monitor input or configure inputs.conf
directly.
Configure monitoring through Splunk Web
If you have access to Splunk Web on your forwarder:
- Log in to Splunk Web.
- Select Settings > Data inputs > Files & directories.
- Click New.
- Click Browse next to the File or Directory field.
- Navigate to the log file generated by the NGINX server and click Next.
- On the Input Settings page, click the Source type drop-down box and then type nginx in the filter field and select one of the following source types depending on your access log format:
nginx:plus:access
: the predefined combined formatnginx:plus:kv
: the custom key-value pair formatnginx:plus:error
: NGINX error lognginx:app:protect
: NGINX App Protect Security log
- Click Next.
- Click Review.
- After you review the information, click Submit.
- Repeat the above steps if you want to ingest more log files.
After you finish configuring inputs, run one or more of the following searches to check that you are ingesting the data that you expect.
sourcetype=nginx:plus:access
sourcetype=nginx:plus:kv
sourcetype=nginx:plus:error
sourcetype=nginx:app:protect
Configure inputs.conf
You can create an inputs.conf
file and configure the monitor input in this file instead of using Splunk Web.
- Using a text editor, create a file named
inputs.conf
in the local folder of the add-on: $SPLUNK_HOME/etc/apps/Splunk_TA_nginx/local
in Unix-based environments.%SPLUNK_HOME%\etc\apps\Splunk_TA_nginx\local
in Windows-based environments.- Add the following stanzas that match the log formats you want to collect, replacing
<path>
with the actual path to the log file. - NGINX access log in the predefined combined format
- NGINX access log in the custom key-value pair format
- NGINX error log
- NGINX App Protect security log
- Save the file.
- Restart the forwarder in order for the new input to take effect.
- Run one or more of the following searches to check that you are ingesting the data that you expect.
sourcetype=nginx:plus:access
sourcetype=nginx:plus:kv
sourcetype=nginx:plus:error
sourcetype=nginx:app:protect
[monitor:///<path>] disabled = false sourcetype = nginx:plus:access
[monitor:///<path>] disabled = false sourcetype = nginx:plus:kv
[monitor:///<path>] disabled = false sourcetype = nginx:plus:error
[monitor:///<path>] disabled = false sourcetype = nginx:app:protect
Configure NGINX logging and monitoring | Configure NGINX status API input |
This documentation applies to the following versions of Splunk® Supported Add-ons: released
Feedback submitted, thanks!