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

**Full name**: projects.locations.instances.forwarders.importStatsEvents

forwarders.importStatsEvents imports stats events from a forwarder.

### HTTP request

`POST https://{endpoint}/v1/{name}:importStatsEvents`

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. The ID of the forwarder. Format: projects/{project}/locations/{location}/instances/{instance}/forwarders/{forwarder} |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "inlineSource": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.forwarders/importStatsEvents#InlineSource`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The source of the events to be imported. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `inlineSource` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.forwarders/importStatsEvents#InlineSource`)`` StatsEvents to be imported are specified inline. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body is empty.

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

- `chronicle.forwarders.importStatsEvents`

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

## InlineSource

An import source with the events to import included inline.

| JSON representation |
|---|
| ``` { "events": [ { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.forwarders/importStatsEvents#IngestionStatsEvent`) } ], "eventBatchId": string } ``` |

| Fields ||
|---|---|
| `events[]` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/v1/projects.locations.instances.forwarders/importStatsEvents#IngestionStatsEvent`)`` Required. The events being imported. |
| `eventBatchId` | `string (https://developers.google.com/discovery/v1/type-format format)` Required. Batch Id to use when ingesting StatsEvents. A base64-encoded string. |

## IngestionStatsEvent

message to represent the stats related event forwarder will send.

| JSON representation |
|---|
| ``` { "eventTime": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "stats": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/StatsEvent`) }, "agentStats": { object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/AgentStatsEvent`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `eventTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Required. The timestamp of the event. 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"`. |
| The stats event to be imported, either StatsEvent or AgentStatsEvent. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `stats` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/StatsEvent`)`` StatsEvent generated by the forwarder. |
| `agentStats` | ``object (`https://docs.cloud.google.com/chronicle/docs/reference/rest/Shared.Types/AgentStatsEvent`)`` AgentStatsEvent generated by the collection agent. |
| End of mutually exclusive fields. ||