Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Rodriguez committed Nov 13, 2023
1 parent 237a5c2 commit a15e980
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 11 additions & 11 deletions exporter/chronicleexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions exporter/chronicleexporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a15e980

Please sign in to comment.