# New Relic

The *New Relic* output plugin lets you send logs to New Relic.

## Configuration parameters

| Key           | Description                                                                                                                                         | Default                               |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| `api_key`     | Your [New Relic API key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/). Either an `api_key` or `license_key` is required.     | *none*                                |
| `base_uri`    | The New Relic API endpoint.                                                                                                                         | `https://log-api.newrelic.com/log/v1` |
| `compress`    | Sets the compression mechanism for the payload. Possible values: `gzip` or `false`.                                                                 | `gzip`                                |
| `license_key` | Your [New Relic license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/). Either an `api_key` or `license_key` is required. | *none*                                |
| `workers`     | Sets the number of [workers](/manual/administration/multithreading.md#outputs) to perform flush operations for this output.                         | `0`                                   |

## Example configuration

The following example configuration uses a `dummy` input plugin and a `nrlogs` output plugin.

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
service:
  flush: 1
  log_level: info

pipeline:
  inputs:
    - name: dummy
      dummy: '{"message":"a simple message", "temp": "0.74", "extra": "false"}'
      samples: 1

  outputs:
    - name: nrlogs
      match: '*'
      api_key: YOUR_API_KEY_HERE
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```
[SERVICE]
  Flush     1
  Log_Level info

[INPUT]
  Name      dummy
  Dummy     {"message":"a simple message", "temp": "0.74", "extra": "false"}
  Samples   1

[OUTPUT]
  Name      nrlogs
  Match     *
  Api_Key   YOUR_API_KEY_HERE
```

{% endtab %}
{% endtabs %}

Run Fluent Bit with the new configuration file:

```shell
# For YAML configuration.
fluent-bit --config fluent-bit.yaml

# For classic configuration
fluent-bit --config fluent-bit.conf
```

Fluent Bit output:

```
...
[2020/04/10 10:58:35] [ info] [output:nrlogs:nrlogs.0] log-api.newrelic.com:443, HTTP status=202
{"requestId":"feb312fe-004e-b000-0000-0171650764ac"}
...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fluentbit.io/manual/data-pipeline/outputs/new-relic.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
