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

**Full name**: projects.locations.instances.ontologyRecords.mappingRules.save

Saves a mapping rule configuration for a specific ontology record. This is used to persist new rules or updates to existing mapping logic.

### HTTP request

`POST https://{endpoint}/v1alpha/{parent}/mappingRules:save`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource name. Format: projects/{project}/locations/{location}/instances/{instance}/ontologyRecords/{ontologyRecord} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "securityEventFieldName": string, "transformationFunction": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#TransformationFunction`), "rawDataPrimaryFieldMatchTerm": string, "rawDataPrimaryFieldComparisonType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`), "enrichmentFields": [ string ], "isArtifact": boolean, "extractionFunction": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ExtractionFunction`), "ontologyConfigurationLevel": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#OntologyConfigurationLevel`), "targetFieldType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#TargetFieldType`), "transformationFunctionParam": string, "rawDataSecondaryFieldMatchTerm": string, "rawDataSecondaryFieldComparisonType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`), "rawDataThirdFieldMatchTerm": string, "rawDataThirdFieldComparisonType": enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`), "extractionFunctionParam": string, "eventName": string } ``` |

| Fields ||
|---|---|
| `securityEventFieldName` | `string` Required. The name of the security event field. |
| `transformationFunction` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#TransformationFunction`)`` Required. The transformation function to apply. |
| `rawDataPrimaryFieldMatchTerm` | `string` Required. The primary field match term in the raw data. |
| `rawDataPrimaryFieldComparisonType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`)`` Required. The comparison type for the primary field. |
| `enrichmentFields[]` | `string` Optional. Enrichment fields (if any). |
| `isArtifact` | `boolean` Required. Indicates if this rule is for artifact extraction. |
| `extractionFunction` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ExtractionFunction`)`` Required. The extraction function to apply. |
| `ontologyConfigurationLevel` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#OntologyConfigurationLevel`)`` Required. Ontology Configuration Level. |
| `targetFieldType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#TargetFieldType`)`` Required. Target Field Type. |
| `transformationFunctionParam` | `string` Optional. Parameters for the transformation function (if any). |
| `rawDataSecondaryFieldMatchTerm` | `string` Optional. The secondary field match term in the raw data (optional). |
| `rawDataSecondaryFieldComparisonType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`)`` Optional. The comparison type for the secondary field. |
| `rawDataThirdFieldMatchTerm` | `string` Optional. The third field match term in the raw data (optional). |
| `rawDataThirdFieldComparisonType` | ``enum (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1alpha/projects.locations.instances.ontologyRecords.mappingRules#ComparisonType`)`` Optional. The comparison type for the third field. |
| `extractionFunctionParam` | `string` Optional. Extraction function parameters (if any). |
| `eventName` | `string` Optional. The event name of the ontology event. |

### Response body

If successful, the response body is an empty JSON object.

### 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 `parent` resource:

- `chronicle.mappingRules.update`

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