To forward logs to New Relic using Fluentd, ensure your configuration meets the following requirements:
To enable log management with Fluentd:
- Install the Fluentd plugin.
- Configure the Fluentd plugin.
- Optional: Configure EU Endpoint
- Test the Fluentd plugin.
- Generate some traffic and wait a few minutes, then check your account for data.
To install the Fluentd plugin:
If you're configuring Fluentd for the first time, you may find it helpful to review our collection of pre-built configuration files addressing common use cases.
To configure your Fluentd plugin:
Restart the Fluentd service to ensure your changes are applied.
By default the Fluentd plugin forwards logs to New Relic's US endpoint:
https://log-api.newrelic.com/log/v1. If your account is on New Relic's EU datacenter then you will need to manually set the
base_uri property to the EU endpoint. For example:
To test if your Fluentd plugin is receiving input from a log file:
Run the following command to append a test log message to your log file:
echo "test message" >> /PATH/TO/YOUR/LOG/FILE
Search New Relic Logs UI for
If everything is configured correctly and your data is being collected, you should see data logs in both of these places:
New Relic tools for running NRQL queries. For example, you can execute a query like this:SELECT * FROM Log
Now that you've enabled Logs, here are some potential next steps:
- Explore your data using the Logs UI.
- Configure your agent to see contextual log data, such as distributed tracing, stack traces, application logs, and more.
- Query your data and create custom dashboards or alerts.
If no data appears after you enable New Relic Logs, follow the troubleshooting procedures.