To use New Relic Logs with Fluent Bit, ensure your configuration meets the following requirements:
- New Relic license key (recommended) or Insert API key
- Fluent Bit 0.12 or higher is supported; however, version 1.0 or higher is recommended.
To forward your logs to New Relic using Fluent Bit:
- Install the Fluent Bit plugin.
- Configure the Fluent Bit plugin.
- Test the Fluent Bit plugin.
- Generate some traffic and wait a few minutes, then check your account for data.
We have published a container with the plugin installed. It serves as a base image to be used by our Kubernetes integration. We recommend you use this base image and layer your own custom configuration files.
To install the Fluent Bit plugin:
Navigate to New Relic's Fluent Bit plugin repository on GitHub.
From the repository page, clone or download the repository.
Run the following command to build your plugin:cd newrelic-fluent-bit-output && make all
Make sure to store
out_newrelic_winXX.dllat a location that can be accessed by the fluent-bit daemon.
If you'd rather not compile the plugin yourself, you can download pre-compiled versions from our repository's releases page.
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.
Locate or create a
plugins.conffile in your plugins directory.
plugins.conffile, add a reference to
out_newrelic.so, adjacent to your
[PLUGINS] Path /PATH/TO/newrelic-fluent-bit-output/out_newrelic.so
fluent-bit.conffile, add the following line under the
serviceblock:[SERVICE]# This is the main configuration block for fluent bit.# Ensure the follow line exists somewhere in the SERVICE blockPlugins_File plugins.conf
[INPUT] Name tail Path /PATH/TO/YOUR/LOG/FILE [OUTPUT] Name newrelic Match * licenseKey YOUR_LICENSE_KEY # Optional maxBufferSize 256000 maxRecords 1024
Restart your Fluent Bit instance with the following command:
fluent-bit -c /PATH/TO/fluent-bit.conf
To test if your Fluent Bit 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 UI for
The New Relic license key. Use either
The maximum size the payloads sent, in bytes.
The maximum number of records to send at a time.
New Relic's Insert API key. Use either
If everything is configured correctly and your data is being collected, you should see data logs in both of these places:
New Relic tools for running NRQL queries. For example, you can execute a query like this: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 and create custom dashboards or alerts.
If no data appears after you enable New Relic Logs, follow the troubleshooting procedures.
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's data security and licenses documentation.