Compatibility and requirements
To use New Relic Logs with Fluent Bit, ensure your configuration meets the following requirements:
Active paid or trial New Relic Logs subscription
- New Relic license key (recommended) or Insights Insert key
- Fluent Bit 0.12 or higher is supported; however, version 1.0 or higher is recommended
- Go development environment
Enable Fluent Bit for New Relic Logs
To enable New Relic Logs with 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.
Install the Fluent Bit plugin
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
Configure the Fluent Bit plugin
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
[SERVICE] # This is the main configuration block for fluent bit. # Ensure the follow line exists somewhere in the SERVICE block Plugins_File plugins.conf
[INPUT] Name tail Path /path/to/your/log/file [OUTPUT] Name newrelic Match * licenseKey <LICENSE KEY> # Optional maxBufferSize 256000 maxRecords 1024
Restart your Fluent Bit instance with the following command:
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 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 for
Optional: Configure plugin attributes
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 Insights Insert key. Use either
View log data
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 in Insights and create custom dashboards, charts, or alerts.