- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.request_body)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.LegacyFetchAlertsViewResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#body.aspect_1)
- [AlertListOptions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertListOptions)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertListOptions.SCHEMA_REPRESENTATION)
- [EntityIndicator](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#EntityIndicator)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#EntityIndicator.SCHEMA_REPRESENTATION)
- [AlertFieldAggregationOptions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertFieldAggregationOptions)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertFieldAggregationOptions.SCHEMA_REPRESENTATION)
- [AlertsFeaturePreference](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertsFeaturePreference)
- [AlertList](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertList)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertList.SCHEMA_REPRESENTATION)

**Full name**: projects.locations.instances.legacy.legacyFetchAlertsView

Legacy streaming endpoint for getting alerts (and in some cases, non-alerting detections) along with aggregated fields that match the query.

### HTTP request

`GET https://{endpoint}/v1alpha/{instance}/legacy:legacyFetchAlertsView`

Where `{endpoint}` is one of the [supported service endpoints](https://docs.cloud.google.com/chronicle/docs/reference/rest#rest_endpoints).

### Path parameters

| Parameters ||
|---|---|
| `instance` | `string` Required. The name of the parent resource, which is the SecOps instance. Format: projects/{project}/locations/{location}/instances/{instance} |

### Query parameters

| Parameters ||
|---|---|
| `baselineQuery` | `string` The baseline query is used for this request and its results are cached for subsequent requests, so that supplying additional filters in the snapshotQuery will not require re-running the baseline query. This uses a syntax similar to UDM search, and all fields are supported except for the path prefix `feedbackSummary.*`. Note that entity/event filters in the baseline query would apply to only the top-level consumer detections, so it would not produce the expected results for composite detections. |
| `snapshotQuery` | `string` Required. This uses a syntax similar to UDM search, with support for all fields within 7 levels of nesting within the collection proto. For composite detections, the filters prefixed with "collectionElements.references.event" or "collectionElements.references.entity" are also checked against one-level of producer detections. |
| `timeRange` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`)`` Required. The time range to search for \[Inclusive, Exclusive). |
| `alertListOptions` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertListOptions`)`` Parameters for the Alerts that will be streamed back. |
| `fieldAggregationOptions` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertFieldAggregationOptions`)`` Parameters for the Aggregated Alert fields that will be streamed back. |
| `enableCache` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertsFeaturePreference`)`` If enabled, subsequent requests for the same time range and baseline query will try to leverage our cache to serve the response with filters applied in the snapshot query. |
| `includeNonAlertingDetections` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertsFeaturePreference`)`` Whether to include non-alerting detections in the response. |
| `maxResponseAlertsBytes` | `string (https://developers.google.com/discovery/v1/type-format format)` Optional. The maximum size, in bytes, of the alerts data returned in the response. If the total size of alerts exceeds this limit, the list of alerts is truncated. The `memoryLimitExceeded` field in the response indicates if truncation occurred. If unspecified or set to 0, no size limit is applied. |
| `plaqueTraceLevel (deprecated)` | `integer` Optional. Deprecated. An internal trace level. |
| `maxShardCount (deprecated)` | `integer` Optional. Deprecated. An internal optimization value. |
| `maxBaselineResults (deprecated)` | `integer` Optional. Deprecated. Maximum number of alerts that will be processed for a single request. |
| `includeSimulatedAlerts (deprecated)` | `boolean` Optional. Deprecated: Use `simulatedDataVisibility` instead. If true, include simulated alerts in the response. Default is false which will exclude simulated alerts. |
| `simulatedDataVisibility` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.dashboardScheduledReports#SimulatedDataVisibility`)`` Optional. Specifies visibility of simulated data to include in search results. |

### Request body

The request body must be empty.

### Response body

Depending on the parameters in FetchAlertsViewRequest, stream back some combination of \|alerts\| and \|fieldAggregations\|.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "progress": number, "tooManyAlerts": boolean, "complete": boolean, "validBaselineQuery": boolean, "baselineAlertsCount": integer, "validSnapshotQuery": boolean, "queryValidationErrors": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/ErrorMessage`) } ], "runtimeErrors": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/RuntimeError`) } ], "filteredAlertsCount": integer, "memoryLimitExceeded": boolean, "alerts": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertList`) }, "fieldAggregations": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/AlertFieldAggregations`) } } ``` |

| Fields ||
|---|---|
| `progress` | `number` Progress of the query represented as a double between 0 and 1. |
| `tooManyAlerts` | `boolean` If true, there are too many alerts matched and some have been omitted from both the `alerts` and from the fieldAggregations. "Too many alerts" depends on the server-side limit of 1,000,000 matched alerts to serve as a base for the field aggregations, rather than on the `maxReturnedAlerts` option. |
| `complete` | `boolean` Streaming for this response is done. There will be no additional updates. |
| `validBaselineQuery` | `boolean` Whether the request baselineQuery is a valid structured query. If not, `queryValidationErrors` will include the parse error. |
| `baselineAlertsCount` | `integer` The number of alerts matched by the baseline query. |
| `validSnapshotQuery` | `boolean` Whether the request baseline and snapshot queries are valid. If not, `queryValidationErrors` will include the parse error. |
| `queryValidationErrors[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/ErrorMessage`)`` Parse error for the baselineQuery and/or the snapshotQuery. |
| `runtimeErrors[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/RuntimeError`)`` Runtime errors. |
| `filteredAlertsCount` | `integer` The number of alerts in the snapshot that match the snapshotQuery. This is \<= `baselineAlertsCount`. If the snapshot query is empty this will be equivalent to `baselineAlertsCount`. |
| `memoryLimitExceeded` | `boolean` True if the list of alerts was truncated because its total size exceeded the `maxResponseAlertsBytes` limit in the request. |
| `alerts` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#AlertList`)`` The list of the first N matched alerts. The value of N is determined by the AlertListOptions.max_returned_alerts field in the request. |
| `fieldAggregations` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/AlertFieldAggregations`)`` List of fields with aggregated values. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `
  https://www.googleapis.com/auth/chronicle`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permission on the `instance` resource:

- `chronicle.legacies.legacyFetchAlertsView`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## AlertListOptions

| JSON representation |
|---|
| ``` { "maxReturnedAlerts": integer, "entityIndicator": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#EntityIndicator`) } } ``` |

| Fields ||
|---|---|
| `maxReturnedAlerts` | `integer` |
| `entityIndicator` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchAlertsView#EntityIndicator`)`` |

## EntityIndicator

| JSON representation |
|---|
| ``` { "indicatorNamespace": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "hostname": string, "assetIpAddress": string, "mac": string, "productId": string, "userName": string, "email": string, "employeeId": string, "windowsSid": string, "projectObjectId": string, "productObjectId": string, "rawPid": string, "processId": string, "fullCommandLine": string, "parentProcessId": string, "hashMd5": string, "hashSha1": string, "hashSha256": string, "filePath": string, "destinationIpAddress": string, "domainName": string, "resourceProjectObjectId": string, "resourceName": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `indicatorNamespace` | `string` |
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `hostname` | `string` |
| `assetIpAddress` | `string` |
| `mac` | `string` |
| `productId` | `string` |
| `userName` | `string` |
| `email` | `string` |
| `employeeId` | `string` |
| `windowsSid` | `string` |
| `projectObjectId (deprecated)` | `string` > [!WARNING] > This item is deprecated! |
| `productObjectId` | `string` |
| `rawPid` | `string` |
| `processId` | `string` |
| `fullCommandLine` | `string` |
| `parentProcessId` | `string` |
| `hashMd5` | `string` |
| `hashSha1` | `string` |
| `hashSha256` | `string` |
| `filePath` | `string` |
| `destinationIpAddress` | `string` |
| `domainName` | `string` |
| `resourceProjectObjectId (deprecated)` | `string` > [!WARNING] > This item is deprecated! |
| `resourceName` | `string` |
| End of mutually exclusive fields. ||

## AlertFieldAggregationOptions

| JSON representation |
|---|
| ``` { "maxValuesPerField": integer } ``` |

| Fields ||
|---|---|
| `maxValuesPerField` | `integer` |

## AlertsFeaturePreference

A generic option to enable or disable a feature.

| Enums ||
|---|---|
| `ALERTS_FEATURE_PREFERENCE_UNSPECIFIED` | An unspecified preference. Behavior will depend on the server defaults. |
| `ALERTS_FEATURE_PREFERENCE_ENABLED` | Enable the feature. |
| `ALERTS_FEATURE_PREFERENCE_DISABLED` | Disable the feature. |

## AlertList

| JSON representation |
|---|
| ``` { "alerts": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection`) } ] } ``` |

| Fields ||
|---|---|
| `alerts[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection`)`` |