Workflow Actions
New Relic: Search Logs
Business
Description
Search for logs in New Relic using NRQL (New Relic Query Language). The action runs a query against the Log data type with your chosen time range and returns matching log entries for use in your Incident Workflow.
Instructions
- If you have not done so, follow the instructions to Create an Incident Workflow.
- When the instructions prompt you to add actions, select this action.
- Enter the following Inputs and click Save.
- Continue following instructions to Publish the Workflow.
- When the action runs, you will see the Outputs listed below.
Inputs
Field References
Fields with the {+} icon accept Field References, which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click {+}, or enter {{, and select relevant fields. Refer to the Field References article for more information.
| Name | Description |
|---|---|
| Integration | Select a Workflow Integration or click New New Relic Connection to create one. |
| NRQL Query | The NRQL SELECT clause for the logs you want (e.g. SELECT * or SELECT message, newrelic.source). The action automatically adds FROM Log and your configured time range. Default: SELECT *. |
| Start Time | The start of the search window. Options: Past 1 Minute, 5m, 10m, 15m, 30m, 1h, 4h, 1d, 2d, 7d, 14d, 30d. Default: 1h (Past 1 Hour). |
| End Time | The end of the search window. Options: Now or the same past intervals as Start Time. Default: Now. |
| Limit | Maximum number of log entries to return. Min: 1, max: 1000. Default: 100. |
Outputs
| Name | Description |
|---|---|
| Logs | JSON array of log entries returned from New Relic. |
| Log Count | Total number of matching logs returned. |
| NRQL Query Used | The full NRQL query sent to New Relic (including FROM Log, time range, and LIMIT). |
| Time Range Start | Start time used for the search (Unix timestamp in milliseconds). |
| Time Range End | End time used for the search (Unix timestamp in milliseconds). |
| Result | Whether the action succeeded: Success or Failed. |
| Result Summary | Short description of what the action did or why it failed. |
| Error | Error message, if the action failed. |