- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.request_body)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.LegacySearchRulesAlertsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#body.aspect_1)
- [RuleStatus](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleStatus)
- [RuleAlertsList](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleAlertsList)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleAlertsList.SCHEMA_REPRESENTATION)
- [Rule](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#Rule)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#Rule.SCHEMA_REPRESENTATION)
- [RuleProperties](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleProperties)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleProperties.SCHEMA_REPRESENTATION)
- [LiveRuleStatus](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#LiveRuleStatus)
- [ExecutionState](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#ExecutionState)
- [RunFrequency](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RunFrequency)
- [RLNameVersions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RLNameVersions)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RLNameVersions.SCHEMA_REPRESENTATION)
- [PolicyRuleType](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#PolicyRuleType)
- [DTNameVersions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#DTNameVersions)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#DTNameVersions.SCHEMA_REPRESENTATION)

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

RPC to get the list of Rules Engine generated alerts for a customer.

### HTTP request

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

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. Chronicle instance this request is sent to. Format: projects/{project}/locations/{location}/instances/{instance} |

### Query parameters

| Parameters ||
|---|---|
| `timeRange` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`)`` Required. Time range \[start, end) for alerts to retrieve. All RE alerts with the detection _time that fall in this time range are returned. |
| `maxNumAlertsToReturn` | `integer` Optional. The maximum number of alerts to return. The default and maximum value is 10,000; values above that will be coerced to 10,000. When the number of available alerts is greater than this value, the response will contain a tooManyAlerts field set to true. |
| `status` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleStatus`)`` Optional. When this field is not set, uses ACTIVE by default. |

### Request body

The request body must be empty.

### Response body

List of Rules alerts aggregated by Rule

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

| JSON representation |
|---|
| ``` { "ruleAlerts": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleAlertsList`) } ], "tooManyAlerts": boolean } ``` |

| Fields ||
|---|---|
| `ruleAlerts[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleAlertsList`)`` Alerts generated by the Rules engine. One entry for each Rule created by the customer |
| `tooManyAlerts` | `boolean` Indicates that more data was available but not sent due to more hits than maxNumAlertsToReturn. |

### 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.legacySearchRulesAlerts`

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

## RuleStatus

| Enums ||
|---|---|
| `ACTIVE` |   |
| `ARCHIVED` |   |
| `ALL` |   |

## RuleAlertsList

| JSON representation |
|---|
| ``` { "ruleMetadata": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#Rule`) }, "alerts": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/YaraL2Detection`) } ] } ``` |

| Fields ||
|---|---|
| `ruleMetadata` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#Rule`)`` |
| `alerts[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/YaraL2Detection`)`` |

## Rule

| JSON representation |
|---|
| ``` { "ruleId": string, "properties": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleProperties`) }, "ruleCompilationError": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/RuleCompilationError`) }, "hasNonexistenceChecks": boolean } ``` |

| Fields ||
|---|---|
| `ruleId` | `string` |
| `properties` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RuleProperties`)`` |
| `ruleCompilationError` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/RuleCompilationError`)`` |
| `hasNonexistenceChecks` | `boolean` |

## RuleProperties

| JSON representation |
|---|
| ``` { "name": string, "metadata": { string: string, ... }, "lastUpdateTime": string, "liveRuleStatus": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#LiveRuleStatus`), "executionState": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#ExecutionState`), "ruleNotificationEnabled": boolean, "lastAlertStatusChangeTime": string, "userFacingRuleType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UserFacingRuleType`), "text": string, "creationTime": string, "archivedTimestamp": string, "runFrequency": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RunFrequency`), "allowedRunFrequencies": [ enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RunFrequency`) ], "nearRealTimeLiveRuleEligible": boolean, "rlNameVersions": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RLNameVersions`) }, "policy": string, "policyRuleType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#PolicyRuleType`), "dtNameVersions": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#DTNameVersions`) } } ``` |

| Fields ||
|---|---|
| `name` | `string` |
| `metadata` | `map (key: string, value: string)` An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `lastUpdateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `liveRuleStatus` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#LiveRuleStatus`)`` |
| `executionState` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#ExecutionState`)`` Output only. |
| `ruleNotificationEnabled` | `boolean` |
| `lastAlertStatusChangeTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `userFacingRuleType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UserFacingRuleType`)`` |
| `text` | `string` |
| `creationTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `archivedTimestamp` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `runFrequency` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RunFrequency`)`` |
| `allowedRunFrequencies[]` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RunFrequency`)`` |
| `nearRealTimeLiveRuleEligible` | `boolean` |
| `rlNameVersions` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#RLNameVersions`)`` |
| `policy` | `string` |
| `policyRuleType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#PolicyRuleType`)`` |
| `dtNameVersions` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRulesAlerts#DTNameVersions`)`` |

## LiveRuleStatus

| Enums ||
|---|---|
| `LIVE_RULE_STATUS_UNSPECIFIED` |   |
| `ENABLED` |   |
| `DISABLED` |   |

## ExecutionState

| Enums ||
|---|---|
| `EXECUTION_STATE_UNSPECIFIED` |   |
| `DEFAULT` |   |
| `LIMITED` |   |
| `PAUSED` |   |

## RunFrequency

| Enums ||
|---|---|
| `RUN_FREQUENCY_UNSPECIFIED` |   |
| `RUN_FREQUENCY_REALTIME` |   |
| `RUN_FREQUENCY_HOURLY` |   |
| `RUN_FREQUENCY_DAILY` |   |
| `RUN_FREQUENCY_REALTIME_CUSTOMIZABLE` |   |
| `RUN_FREQUENCY_HOURLY_CUSTOMIZABLE` |   |
| `RUN_FREQUENCY_USER_DEFINED` |   |

## RLNameVersions

| JSON representation |
|---|
| ``` { "nameVersions": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `nameVersions` | ``map (key: string, value: string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format))`` An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

## PolicyRuleType

| Enums ||
|---|---|
| `POLICY_RULE_TYPE_UNSPECIFIED` |   |
| `HUNTING` |   |
| `PRODUCTION` |   |
| `FOUNDATIONAL` |   |

## DTNameVersions

| JSON representation |
|---|
| ``` { "nameVersions": { string: string, ... } } ``` |

| Fields ||
|---|---|
| `nameVersions` | `map (key: string, value: string (https://developers.google.com/discovery/v1/type-format format))` An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |