Kubernetes plugin for Logs

New Relic offers a Fluent Bit output plugin to connect your Kubernetes cluster log data to New Relic Logs. This document explains how to enable this feature.

Compatibility and requirements

Logs requires an active trial or paid subscription for any New Relic product.

To use New Relic Logs with the Kubernetes plugin, ensure your configuration meets the following requirements:

Enable Kubernetes for New Relic Logs

To enable New Relic Logs with the Fluent Bit Kubernetes plugin:

  1. Install the Kubernetes plugin.
  2. Configure the Kubernetes plugin.
  3. Generate some traffic and wait a few minutes, then check your account for data.
  4. Optional: Configure Fluent Bit parsing.

Install the Kubernetes plugin

To install the Kubernetes plugin:

  1. Navigate to the Kubernetes plugin GitHub repository.
  2. From the repository page, clone or download the repository.

Configure the Kubernetes plugin

Deploying as Helm chart (Recommended)

To deploy your Kubernetes plugin as a Helm chart:

  1. Run the following command in your terminal or command-line interface, replacing the placeholder value your-license-key with your New Relic license key:

    helm install --set licenseKey=your-license-key ./helm/newrelic-logging

    For EU users, add --set fluentBit.endpoint=https://log-api.eu.newrelic.com/log/v1 to the helm install command above.

Configure manually

To configure your Kubernetes plugin manually:

  1. In the downloaded new-relic-fluent-plugin.yml file, replace the placeholder value <LICENSE_KEY > with your New Relic license key.

    For EU users, replace the ENDPOINT environment variable to https://log-api.eu.newrelic.com/log/v1.

  2. Once the License key has been added, run the following command in your terminal or command-line interface:

    kubectl apply -f .

View log data

If everything is configured correctly and your data is being reported, you should see data logs in the New Relic Logs UI or by going to Insights and querying:


Optional: Configure parsing

Once you have installed and configured the Kubernetes plugin, you can configure how the plugin parses the data. For more information, see Fluent Bit's documentation on Parsers configuration.

By default, tailing is set to /var/log/containers/*.log. To change this setting, replace the default path with your preferred path in the new-relic-fluent-plugin.yml file.



You are receiving the following error:

[ warn] [filter_kube] invalid pattern for given tag


In the new-relic-fluent-plugin.yml file, replace the default code /var/log/containers/*.log with the following:


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

Recommendations for learning more: