Compatibility and requirements
To use New Relic Logs with Fluentd, ensure your configuration meets the following requirements:
Active paid or trial New Relic Logs subscription.
- New Relic license key (recommended) or Insights Insert key
- Fluentd 1.0 or higher
- Ruby development environment
Enable Fluentd for New Relic Logs
To enable New Relic Logs with Fluentd:
- Install the Fluentd plugin.
- Configure the Fluentd plugin.
- Test the Fluentd plugin.
- Optional: Configure additional plugin attributes.
- Generate some traffic and wait a few minutes, then check your account for data.
Install the Fluentd plugin
To install the Fluentd plugin:
- Install using fluent-gem install
To install using
fluent-gem install, enter the following command into your terminal or command line interface:
fluent-gem install fluent-plugin-newrelic
- Install using td-agent-gem
To install using the td-agent plugin, enter the following command into your terminal or command line interface:
td-agent-gem install fluent-plugin-newrelic
Configure the Fluentd plugin
To configure your Fluentd plugin:
td-agent.confif using the td-agent, add the following block of data, replacing the placeholder text with your New Relic license key or Insights Insert key.
Configure with the New Relic license key (recommended):
<match **> @type newrelic license_key <new_relic_license_key> </match>
Or, configure with the New Relic Insights API Insert key:
<match **> @type newrelic api_key <INSIGHTS_INSERT_KEY> </match>
- Restart your Fluentd instance.
Test the Fluentd plugin
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 for
|base_uri||The New Relic ingestion endpoint.||US endpoint:
View log data
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 in Insights and create custom dashboards, charts, or alerts.