• /
  • EnglishEspañol日本語한국어Português
  • EntrarComeçar agora

Logstash plugin for log forwarding

If your log data is already being monitored by Logstash, you can use our Logstash plugin to forward and enrich your log data in New Relic.

Forwarding your Logstash logs to New Relic will give you enhanced capabilities to collect, process, explore, query, and alert on your log data.

Enable Logstash for log management

To forward your logs from Logstash to New Relic:

  1. Make sure you have:

  2. Install and 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 and configure the Logstash plugin

To forward your logs to New Relic with our Logstash plugin:

  1. Enter the following command into your terminal or command line interface:

    bash
    $
    logstash-plugin install logstash-output-newrelic
  2. In your logstash.conf file, add the following block of data. Be sure to replace the placeholder text with your New Relic .

    output {
    newrelic {
    license_key => "LICENSE_KEY"
    }
    }
  3. Restart your Logstash instance.

Este documento ajudou você na instalação?

Optional configuration

After you install and configure the Logstash plugin, you can use the following attributes to configure how the plugin sends data to New Relic. For more information on adding or configuring attributes, see our Logstash configuration examples in GitHub.

Property

Description

concurrent_requests

The number of threads to make requests from. Default: 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

max_retries

Maximum number attempts to retry to send a message. If set to 0, no re-attempts will be made. Default: 3

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:

    bash
    $
    echo "test message" >> /PATH/TO/YOUR/LOG/FILE
  4. Search our logs UI for test message.

View log data

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

SELECT * FROM Log

If no data appears after you enable our log management capabilities, follow our standard log troubleshooting procedures.

What's next?

Explore logging data across your platform with our logs UI.

Disable log forwarding

To disable log forwarding capabilities, follow standard procedures in Logstash documentation. You do not need to do anything else in New Relic.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.