- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.LegacyFetchUdmSearchCsvResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#body.aspect_1)
- [FetchUdmSearchCsvFields](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FetchUdmSearchCsvFields)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FetchUdmSearchCsvFields.SCHEMA_REPRESENTATION)
- [QueryType](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#QueryType)
- [CsvEntries](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#CsvEntries)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#CsvEntries.SCHEMA_REPRESENTATION)
- [FailureCsvFieldValidation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FailureCsvFieldValidation)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FailureCsvFieldValidation.SCHEMA_REPRESENTATION)

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

Legacy endpoint for fetching csv rows for matching UDM search.

### HTTP request

`POST https://{endpoint}/v1alpha/{instance}/legacy:legacyFetchUdmSearchCsv`

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} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "baselineQuery": string, "snapshotQuery": string, "baselineTimeRange": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`) }, "snapshotTimeRange": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`) }, "fields": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FetchUdmSearchCsvFields`) }, "caseInsensitive": boolean, "simulatedDataVisibility": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.dashboardScheduledReports#SimulatedDataVisibility`), "skipCache": boolean, "skipSafeDownload": boolean, "queryType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#QueryType`) } ``` |

| Fields ||
|---|---|
| `baselineQuery` | `string` Required. The baseline query to search for. |
| `snapshotQuery` | `string` The snapshot query to search for. |
| `baselineTimeRange` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`)`` Required. The time range to search for \[inclusive start time, exclusive end time). |
| `snapshotTimeRange` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/Interval`)`` The time range to filter for \[inclusive start time, exclusive end time). This time range must be completely within `baselineTimeRange`. If not set, it is assumed to match `baselineTimeRange`. |
| `fields` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FetchUdmSearchCsvFields`)`` Required. The fields in UDM Event whose values need to be used to create the CSV File. |
| `caseInsensitive` | `boolean` If true, the search should be performed in a case-insensitive manner. This applies to both baseline and snapshot queries. |
| `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. |
| `skipCache` | `boolean` Optional. If `true`, bypass reading from cache, executing the search fresh against primary storage. |
| `skipSafeDownload` | `boolean` Optional. By default false. In this case the CSV having invalid fields will be downloaded.If true, the CSV will not be downloaded. |
| `queryType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#QueryType`)`` Optional. The type of the query in the request. |

### Response body

Response with the CSV entries to append to file in UI along with progress.

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

| JSON representation |
|---|
| ``` { "progress": number, "tooManyEvents": boolean, "complete": boolean, "validBaselineQuery": boolean, "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`) } ], "csv": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#CsvEntries`) }, "failureCsvFieldValidations": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FailureCsvFieldValidation`) } ] } ``` |

| Fields ||
|---|---|
| `progress` | `number` Progress of the query represented as a double between 0 and 1. |
| `tooManyEvents` | `boolean` If true, there are too many events to return and some have been omitted. |
| `complete` | `boolean` Streaming for this response is done. There will be no additional updates. |
| `validBaselineQuery` | `boolean` Indicates whether the request baselineQuery is a valid structured query or not. If not, `queryValidationErrors` will include the parse error. |
| `validSnapshotQuery` | `boolean` Indicates 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`)`` Output only. Parse error for the baselineQuery and/or the snapshotQuery. |
| `runtimeErrors[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/RuntimeError`)`` Runtime errors. |
| `csv` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#CsvEntries`)`` List of CSV rows |
| `failureCsvFieldValidations[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.legacy/legacyFetchUdmSearchCsv#FailureCsvFieldValidation`)`` List of invalid CSV fields. |

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

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

## FetchUdmSearchCsvFields

| JSON representation |
|---|
| ``` { "fields": [ string ] } ``` |

| Fields ||
|---|---|
| `fields[]` | `string` |

## QueryType

The type of the query in the request.

| Enums ||
|---|---|
| `UNKNOWN` | The default query type. Denotes that the query is not being set. |
| `UDM_QUERY` | UDM query. |
| `RAW_LOG_QUERY` | Raw log query. |

## CsvEntries

| JSON representation |
|---|
| ``` { "row": [ string ], "timestamps": [ string ] } ``` |

| Fields ||
|---|---|
| `row[]` | `string` |
| `timestamps[]` | ``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"`. |

## FailureCsvFieldValidation

| JSON representation |
|---|
| ``` { "field": string } ``` |

| Fields ||
|---|---|
| `field` | `string` |