If your log data is already being monitored by Fluent Bit, you can use our Fluent Bit output plugin to forward and enrich your log data in New Relic.
Forwarding your Fluent Bit logs to New Relic will give you enhanced capabilities to collect, process, explore, query, and alert on your log data. You have these options to install the Fluent Bit:
Kubernetes installation
New Relic has a Fluent Bit output plugin to forward your logs to New Relic log management. You can install this plugin as a standalone Docker image in a Kubernetes cluster, where it functions as a DaemonSet, also known as the Kubernetes plugin.
You can install it in your cluster using our Helm chart in two ways:
- Through our guided install
- Manual installation
Using our guided install
Although the newrelic-logging
chart works as a standalone, we recommend installing it as part of the nri-bundle
chart.
The best way to install this is through our guided installation process. This guided install generates the Helm commands required to install it.
Manual installation
You can install it manually using Helm, although this option is not recommended. Run this command to install the repo:
$helm repo add newrelic https://helm-charts.newrelic.com
To update the repo, run this command:
$helm repo update newrelic
Dica
See our supported configuration parameters in our newrelic-logging
Helm chart.
See Uninstall Kubernetes integration if you want to uninstall it.
Using a Docker image
If you've your own custom kubernetes integration, we recommend using our Docker image that comes with the newrelic-fluent-bit-output
plugin. Or you can use the Docker image as a base image and layer your own custom configuration files.
On-host installation
For an on-host installation of the Fluent Bit plugin, follow these steps:
Open the New Relic's Fluent Bit plugin repository on GitHub.
From the repository page, clone or download the repository.
Run this command to build your plugin:
bash$cd newrelic-fluent-bit-output && make allStore
out_newrelic.so
orout_newrelic_winXX.dll
at a location wherefluent-bit
daemon can access them.
Dica
If you'd rather not compile the plugin yourself, download pre-compiled versions from our GitHub repository's releases page.
Upgrade the Fluent Bit plugin
Before you upgrade your Fluent Bit plugin, run the following NRQL query to find the current versions of the output plugin you're using in your system:
FROM K8sContainerSample SELECT latest(containerImage) WHERE podName like '%newrelic-logging%' FACET clusterName
Cuidado
The security vulnerability (CVE-2024-4323) affects Fluent Bit output plugin versions 1.16.0-1.19.2. If you're using one of these versions, update to version 2.0.0 or higher. For more information on this, see our security bulletin NR24-01 - Fluent Bit.
To update, follow the installation instructions or grab the latest pre-compiled version from our GitHub repository.
Configure the Fluent Bit plugin
Fluent Bit needs to know the location of the New Relic plugin and the New Relic to output data to New Relic.
Importante
Pay attention to white space when editing your config files. Be sure to use four spaces to indent and one space between keys and values.
To configure your Fluent Bit plugin, follow these steps:
Locate or create the
plugins.conf
file in your plugins directory.In the
plugins.conf
file, add a reference toout_newrelic.so
, adjacent to yourfluent-bit.conf
file:[PLUGINS]Path /PATH/TO/newrelic-fluent-bit-output/out_newrelic.soIn the
fluent-bit.conf
file, add the following line under theservice
block:[SERVICE]# This is the main configuration block for fluent bit.# Ensure the follow line exists somewhere in the SERVICE blockPlugins_File plugins.confAt the bottom of the
fluent-bit.conf
file, add the following to set up the input, filter, and output sections. Replace the placeholder text with your :[INPUT]Name tailTag my.tagPath /PATH/TO/YOUR/LOG/FILE# If you have multiple sources, just add another [INPUT] section like this:[INPUT]Name tailTag my.other.tagPath /PATH/TO/SOME/OTHER/LOG/FILE# Having multiple [FILTER] blocks allows you to control the flow of changes as they read top down.[FILTER]Name modify# Here we only match on one tag, my.tag, defined in the [INPUT] section earlierMatch my.tag# Below, we're renaming the host.cpu attribute to CPURename host.cpu CPU[FILTER]Name record_modifier# Match on all tags, *, so all logs get decorated per the Record clauses below. Record adds attributes + their values to each record.Match *# Adding a logtype attribute ensures your logs will be automatically parsed by our built-in parsing rulesRecord logtype nginx# Add the server's hostname to all logs generatedRecord hostname ${HOSTNAME}[OUTPUT]Name newrelicMatch *licenseKey YOUR_LICENSE_KEYRestart your Fluent Bit instance. Run this command:
bash$fluent-bit -c /PATH/TO/fluent-bit.conf
Test the Fluent Bit plugin
To test if your Fluent Bit plugin is receiving input from a log file:
Run this command to append a test log message to your log file:
bash$echo "test message" >> /PATH/TO/YOUR/LOG/FILESearch for
test message
in our logs UI .
For more options, see the modify
filter on the Fluent Bit documentation. See also our documentation to forward your logs using the infrastructure agent.
Optional: Configure plugin attributes
Once you've installed and configured the Fluent Bit plugin, you can use the following attributes to configure how the plugin sends data to New Relic:
Key | Description |
---|---|
| The . Use either |
| The maximum size the payloads sent, in bytes. Default: |
| The maximum number of records to send at a time. Default: |
| Deprecated. Takes a New Relic insights insert key, but using the |
| Defaults to |
View log data
If you configured everything correctly and New Relic collects your data, you should see log data in both of these places:
Our logs UI
Our tools for running NRQL queries. For example, you can run a query like this:
SELECT * FROM Log
If you don't get any data 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.
Get deeper visibility into both your application and your platform performance data by forwarding your logs with our logs in context capabilities.
Set up alerts.
Disable log forwarding
To disable log forwarding capabilities, follow standard procedures in Fluent Bit documentation. You don't need to do anything else in New Relic.