Logstash plugin for log forwarding

Use our Logstash output plugin to connect your Logstash monitored log data to New Relic. Read on to learn how to enable this feature.

Compatibility and requirements

To forward your logs to New Relic using Logstash, ensure your configuration meets the following requirements:

Enable Logstash for log management

To enable log management using Logstash:

  1. Install the Logstash plugin.
  2. Configure the Logstash plugin.
  3. Optional: Configure additional plugin attributes.
  4. Test the Logstash plugin.
  5. Generate some traffic and wait a few minutes, then check your account for data.

Install the Logstash plugin

To install the Logstash plugin, enter the following command into your terminal or command line interface:

logstash-plugin install logstash-output-newrelic

Configure the Logstash plugin

To configure your Logstash plugin:

  1. In your logstash.conf file, add the following block of data. Be sure to replace the placeholder text with your New Relic license key or Insights Insert key.

    Configure with the New Relic license key (recommended):

    output {
      newrelic {
        license_key => "LICENSE_KEY"
      }
    }
    

    Or, configure with the New Relic Insert API key:

    output {
      newrelic {
        api_key => "INSERT_API_KEY"
      }
    }
  2. Restart your Logstash instance.

Optional configuration

Once you have installed and configured the Logstash plugin, you can use the following attributes to configure how the plugin sends data to New Relic:

Property Description Default value
concurrent_requests The number of threads to make requests from. 1
base_uri The New Relic ingestion endpoint. US endpoint: https://log-api.newrelic.com/log/v1
EU endpoint: https://log-api.eu.newrelic.com/log/v1

For more information on adding or configuring attributes, see Example Configurations for Logstash.

Test the Logstash plugin

To test if your Logstash plugin is receiving input from a log file:

  1. Add the following to your logstash.conf file:

    input {
        file {
          path => "/PATH/TO/YOUR/LOG/FILE"
        }
    }
  2. Restart your Logstash instance.
  3. Run the following command to append a test log message to your log file:

    echo "test message" >> /PATH/TO/YOUR/LOG/FILE
  4. Search New Relic Logs UI for test message.

View log data

If everything is configured correctly and your data is being collected, you should see data logs in both of these places:

What's next?

Now that you've enabled Logs, here are some potential next steps:

If no data appears after you enable New Relic Logs, follow the troubleshooting procedures.

For more help