- [HTTP request](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.GenerateUDMKeyValueMappingsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/projects.locations.instances/generateUdmKeyValueMappings#body.aspect_1)

**Full name**: projects.locations.instances.generateUdmKeyValueMappings

instances.generateUdmKeyValueMappings generates key value mapping of a raw log. For a JSON raw log { "menu": { "id": "file", "popup": { "value": "New", } } } The generated key value mappings will be: "menu.id": "file" "menu.popup.value": "New"

### HTTP request

`POST https://{endpoint}/v1beta/{instance}:generateUdmKeyValueMappings`

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 associated with the request. Format: projects/{project}/locations/{location}/instances/{instance} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "logFormat": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/FieldExtractors#LogFormat`), "log": string, "useArrayBracketNotation": boolean, "compressArrayFields": boolean } ``` |

| Fields ||
|---|---|
| `logFormat` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1beta/FieldExtractors#LogFormat`)`` Log format of the raw log. |
| `log` | `string (https://developers.google.com/discovery/v1/type-format format)` The raw log. A base64-encoded string. |
| `useArrayBracketNotation` | `boolean` Optional. Flag to format arrays as bracket notation. When true, arrays will be serialized with brackets surrounding the index When false, there will be no change in the serialization of arrays and the default dot (.) notation will be used. |
| `compressArrayFields` | `boolean` Optional. Flag to compress array fields. When true, array fields will be truncated to include only the first element and elipssis (...) will be used to indicate if it has more elements. Also there will be no index supplied for the array elements. When false, array fields will be serialized with all elements. |

### Response body

Response message for GenerateUDMKeyValueMappingsResponse.

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

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

| Fields ||
|---|---|
| `fieldMappings` | `map (key: string, value: string)` map of extracted fields. An object containing a list of `"key": value` pairs. Example: `{ "name": "wrench", "mass": "1.3kg", "count": "3" }`. |

### 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.parserExtensions.generateKeyValueMappings`

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