- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.request_body)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.LegacySearchRuleDetectionEventsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#body.aspect_1)
- [OnDemandEventSampleList](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList.SCHEMA_REPRESENTATION)
- [EventSample](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EventSample)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EventSample.SCHEMA_REPRESENTATION)
- [RawLogEventInformation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#RawLogEventInformation)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#RawLogEventInformation.SCHEMA_REPRESENTATION)
- [DataTableEntityGraphEnrichment](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DataTableEntityGraphEnrichment)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DataTableEntityGraphEnrichment.SCHEMA_REPRESENTATION)
- [EnrichmentType](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EnrichmentType)
- [OnDemandDetectionSampleList](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandDetectionSampleList)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandDetectionSampleList.SCHEMA_REPRESENTATION)
- [DetectionSample](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DetectionSample)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DetectionSample.SCHEMA_REPRESENTATION)

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

Legacy RPC for listing events associated with a particular Detection generated by a Rules Engine rule.

### HTTP request

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

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 ||
|---|---|
| `ruleId` | `string` Required. The rule ID that generated the detection. |
| `versionTimestamp` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Optional. The version timestamp of the rule that generated the detection. If omitted, the latest version of the rule will be used. 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"`. |
| `detectionId` | `string` Required. The ID of the detection. |
| `maxEvents` | `integer` Optional. Max events returned over all event variables. The default and limit is 100k events over all event variables. The events of this detection are sorted by event timestamp, truncated to maxEvents events, and grouped by event variable in the response. |

### Request body

The request body must be empty.

### Response body

Events associated with a Rule-generated Detection.

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

| JSON representation |
|---|
| ``` { "resultEvents": { string: { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList`) }, ... }, "resultEntities": { string: { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList`) }, ... }, "resultDetections": { string: { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandDetectionSampleList`) }, ... }, "tooManyEvents": boolean } ``` |

| Fields ||
|---|---|
| `resultEvents` | ``map (key: string, value: object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList`))`` Map from event variable to the event samples. The events for each event variable are sorted by the event timestamp. Note: This field contains both event and entity samples. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `resultEntities` | ``map (key: string, value: object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandEventSampleList`))`` Map from entity event variable to the entity samples. The entities for each event variable are sorted by the entity timerange. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `resultDetections` | ``map (key: string, value: object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#OnDemandDetectionSampleList`))`` Map from detection event variable to the detection samples. The detection ids for each event variable are sorted by the detection timestamp. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |
| `tooManyEvents` | `boolean` True if the request would have returned more event samples than maxEvents allows. |

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

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

## OnDemandEventSampleList

| JSON representation |
|---|
| ``` { "eventSamples": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EventSample`) } ] } ``` |

| Fields ||
|---|---|
| `eventSamples[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EventSample`)`` |

## EventSample

| JSON representation |
|---|
| ``` { "rawLogEventInformation": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#RawLogEventInformation`) }, "rawLogToken": string, "eventId": string, "joinedDataTableRows": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/DataTableRowDetails`) } ], "graphEnrichment": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DataTableEntityGraphEnrichment`) }, "udmNounProvenances": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/EnrichmentProvenance`) } ], "udmProvenance": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UdmProvenance`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "event": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#UDM`) }, "entity": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#Entity`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `rawLogEventInformation (deprecated)` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#RawLogEventInformation`)`` > [!WARNING] > This item is deprecated! |
| `rawLogToken` | `string` |
| `eventId` | `string` |
| `joinedDataTableRows[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/DataTableRowDetails`)`` |
| `graphEnrichment` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DataTableEntityGraphEnrichment`)`` |
| `udmNounProvenances[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/EnrichmentProvenance`)`` |
| `udmProvenance` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/UdmProvenance`)`` |
| The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `event` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#UDM`)`` |
| `entity` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#Entity`)`` |
| End of mutually exclusive fields. ||

## RawLogEventInformation

| JSON representation |
|---|
| ``` { "batchId": string, "offset": integer, "timestamp": string, "eventType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/EventType`), "disambiguationKey": string, "normalizedEventType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/EventType`), "customerId": string, "ttrKeys": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/TtrKeyInfo`) } } ``` |

| Fields ||
|---|---|
| `batchId` | `string (https://developers.google.com/discovery/v1/type-format format)` A base64-encoded string. |
| `offset` | `integer` |
| `timestamp` | ``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"`. |
| `eventType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/EventType`)`` |
| `disambiguationKey` | `string (https://developers.google.com/discovery/v1/type-format format)` A base64-encoded string. |
| `normalizedEventType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/EventType`)`` |
| `customerId` | `string (https://developers.google.com/discovery/v1/type-format format)` A base64-encoded string. |
| `ttrKeys` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/TtrKeyInfo`)`` |

## DataTableEntityGraphEnrichment

| JSON representation |
|---|
| ``` { "dataTable": string, "enrichmentType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EnrichmentType`), "overriddenEntity": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#Entity`) } } ``` |

| Fields ||
|---|---|
| `dataTable` | `string` |
| `enrichmentType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#EnrichmentType`)`` |
| `overriddenEntity` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Collection#Entity`)`` |

## EnrichmentType

| Enums ||
|---|---|
| `ENRICHMENT_TYPE_UNSPECIFIED` |   |
| `APPEND` |   |
| `OVERRIDE` |   |

## OnDemandDetectionSampleList

| JSON representation |
|---|
| ``` { "detectionSamples": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DetectionSample`) } ] } ``` |

| Fields ||
|---|---|
| `detectionSamples[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacySearchRuleDetectionEvents#DetectionSample`)`` |

## DetectionSample

| JSON representation |
|---|
| ``` { "detectionId": string, "ruleId": string, "ruleVersion": string } ``` |

| Fields ||
|---|---|
| `detectionId` | `string` |
| `ruleId` | `string` |
| `ruleVersion` | `string` |