> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Logs

Returns logs that match a log search query.

Use this action to build complex logs filtering and search.

This action may not work if your Datadog workspace does not have logs enabled.

<Warning>
  This action does not support OAuth connections.
</Warning>

<Note>
  External Documentation

  To learn more, visit the [Datadog documentation](https://docs.datadoghq.com/api/latest/logs/#get-a-list-of-logs).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter | Description                                                                                              |
  | --------- | -------------------------------------------------------------------------------------------------------- |
  | Indexes   | For customers with multiple indexes, the indexes to search. Defaults to \['\*'] which means all indexes. |
  | Limit     | Maximum number of logs in the response.                                                                  |
  | Query     | The search query - following the log search syntax.                                                      |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter | Description                                                                         |
  | --------- | ----------------------------------------------------------------------------------- |
  | From      | The minimum time for the requested logs, supports date math and regular timestamps. |
  | Timezone  | The timezone can be specified both as an offset, for example: "UTC+03:00".          |
  | To        | The maximum time for the requested logs, supports date math and regular timestamps. |
</div>

## Example Output

```json theme={"dark"}
{
	"data": [
		{
			"attributes": {
				"attributes": {
					"customAttribute": 123,
					"duration": 2345
				},
				"host": "i-0123",
				"message": "Host connected to remote",
				"service": "agent",
				"status": "INFO",
				"tags": [
					"team:A"
				],
				"timestamp": "2019-01-02T09:42:36.32Z"
			},
			"id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA",
			"type": "log"
		},
		{
			"attributes": {
				"attributes": {
					"customAttribute": 123,
					"duration": 2345
				},
				"host": "i-0123",
				"message": "Host connected to remote",
				"service": "agent",
				"status": "INFO",
				"tags": [
					"team:A"
				],
				"timestamp": "2019-01-02T09:42:36.32Z"
			},
			"id": "AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA",
			"type": "log"
		}
	],
	"links": {
		"next": "https://app.datadoghq.com/api/v2/logs/event?filter[query]=foo\u0026page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="
	},
	"meta": {
		"elapsed": 132,
		"page": {
			"after": "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ=="
		},
		"request_id": "MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR",
		"status": "done",
		"warnings": [
			{
				"code": "unknown_index",
				"detail": "indexes: foo, bar",
				"title": "One or several indexes are missing or invalid, results hold data from the other indexes"
			},
			{
				"code": "unknown_index",
				"detail": "indexes: foo, bar",
				"title": "One or several indexes are missing or invalid, results hold data from the other indexes"
			}
		]
	}
}
```

## Workflow Library Example

[List Logs with Datadog and Send Results Via Email](https://library.blinkops.com/workflows/list-logs-with-datadog-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/list-logs-with-datadog-and-send-results-via-email/canvas" />
</div>
