From a15e9802cf22ebf5db2d272adc96ab10e1a7426e Mon Sep 17 00:00:00 2001 From: Miguel Rodriguez Date: Mon, 13 Nov 2023 17:01:00 -0500 Subject: [PATCH] Add comment --- exporter/chronicleexporter/README.md | 22 +++++++++++----------- exporter/chronicleexporter/exporter.go | 2 ++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/exporter/chronicleexporter/README.md b/exporter/chronicleexporter/README.md index d6fbaf68a..e4afad809 100644 --- a/exporter/chronicleexporter/README.md +++ b/exporter/chronicleexporter/README.md @@ -20,17 +20,17 @@ This exporter facilitates the sending of logs to Chronicle, which is a security The exporter can be configured using the following fields: -| Field | Type | Default | Required | Description | -| ------------------ | ------ | ------- | -------- | --------------------------------------------------------------------------------- | -| `region` | string | | `true` | The region where the data will be sent, it must be one of the predefined regions. | -| `creds_file_path` | string | | `true` | The file path to the Google credentials JSON file. | -| `creds` | string | | `true` | The Google credentials JSON. | -| `log_type` | string | | `true` | The type of log that will be sent. | -| `raw_log_field` | string | | `false` | The field name for raw logs. | -| `customer_id` | string | | `false` | The customer ID used for sending logs. | -| `sending_queue` | struct | | `false` | Configuration for the sending queue. | -| `retry_on_failure` | struct | | `false` | Configuration for retry logic on failure. | -| `timeout_settings` | struct | | `false` | Configuration for timeout settings. | +| Field | Type | Default | Required | Description | +| ------------------ | ------ | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `region` | string | | `false` | The region where the data will be sent, it must be one of the predefined regions. if no region is specfied defaults to `https://malachiteingestion-pa.googleapis.com` | +| `creds_file_path` | string | | `true` | The file path to the Google credentials JSON file. | +| `creds` | string | | `true` | The Google credentials JSON. | +| `log_type` | string | | `true` | The type of log that will be sent. | +| `raw_log_field` | string | | `false` | The field name for raw logs. | +| `customer_id` | string | | `false` | The customer ID used for sending logs. | +| `sending_queue` | struct | | `false` | Configuration for the sending queue. | +| `retry_on_failure` | struct | | `false` | Configuration for retry logic on failure. | +| `timeout_settings` | struct | | `false` | Configuration for timeout settings. | ### Regions diff --git a/exporter/chronicleexporter/exporter.go b/exporter/chronicleexporter/exporter.go index f4e7ca54d..a504f43f9 100644 --- a/exporter/chronicleexporter/exporter.go +++ b/exporter/chronicleexporter/exporter.go @@ -79,6 +79,8 @@ func newExporter(cfg *Config, params exporter.CreateSettings) (*chronicleExporte }, nil } +// buildEndpoint builds the endpoint to send logs to based on the region. there is a default endpoint `https://malachiteingestion-pa.googleapis.com` +// but there are also regional endpoints that can be used instead. the regional endpoints are listed here: https://cloud.google.com/chronicle/docs/reference/search-api#regional_endpoints func buildEndpoint(cfg *Config) string { if cfg.Region != "" && regions[cfg.Region] != "" { return fmt.Sprintf("%s%s", regions[cfg.Region], apiTarget)