---
title: Send logs to New Relic
source: https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/ingest/newrelic-ingest-send-logs
---

Sends log entries to New Relic.

For prerequisites, see [New Relic Ingest actions](https://docs.newrelic.com/docs/workflow-automation/setup-and-configure/actions-catalog/newrelic/ingest/newrelic-ingest#prerequisites).

## Send logs to New Relic

The action identifier is `newrelic.ingest.sendLogs`.

Sends logs to New Relic.

### Inputs

The following table describes all available input fields for this action.

| Input          | Type   | Description                                                                                                                                                                                                                                                                                                                                                            | Example                                                                                                                                   |
| -------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| **attributes** | Map    | **Optional.** Common attributes included in all logs when provided. These merge with each log item, with log-specific values overriding common attributes when conflicts occur.                                                                                                                                                                                        | `"{\"page\": \"1\", \"limit\": \"10\"}"`                                                                                                  |
| **logs**       | List   | **Required.** List of logs. Each log requires a `message` field. Maximum of 100 logs per request.                                                                                                                                                                                                                                                                      | `"[{\"message\":\"XYZ\",\"attributes\":{\"foo\":\"bar\"}}, {\"message\":\"ABC\",\"value\":\"1234\",\"attributes\":{\"color\":\"red\"}}]"` |
| **licenseKey** | String | **Optional.** The New Relic Account License Key specifies the target account for your events. If not provided, the system uses the default license key from the account executing the workflow. [Read more about our API keys](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys#license-key) to create and manage your New Relic Account License Key. | `"{{ .secrets.secretName }}"`, where `secretName` is the key under which the license key is stored.                                       |
| **selectors**  | List   | **Optional.** The selectors to get only the specified parameters as output.                                                                                                                                                                                                                                                                                            |                                                                                                                                           |

### Outputs

The following table describes all output fields returned by this action.

| Output           | Type    | Description                                   |
| ---------------- | ------- | --------------------------------------------- |
| **success**      | Boolean | `true` on success, `false` on failure.        |
| **errorMessage** | String  | Failure reason as message. `null` on success. |

### Example

The following example sends multiple log messages with shared and per-log attributes, then retrieves them with a NRQL query.

| Workflow example                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ```yaml name: heartbeat_newrelicIngestSendLogs  workflowInputs:   cellName:     type: String  steps:   - name: runAction     type: action     action: newrelic.ingest.sendLogs     version: 1     inputs:       attributes:         colour: red         id: 1234       logs:         - message: 'Heartbeat sendLogs Action Test Message'           attributes:             foo: bar         - message: 'HeartBeat1234'           attributes:             foo: bar         - message: 'HeartBeat12345'           attributes:             foo: bar             colour: yellow         - message: 'HeartBeat12345678'       selectors:         - name: success           expression: ".success" ``` **Expected output:** ```yaml   {     "success": true   } ``` **Retrieve logs:** After successfully executing a workflow, you can retrieve the associated log by running a query under the account that executed the workflow: ```sql SELECT * FROM Log ``` |
