---
title: "Forcepoint SWG collector"
canonical: "https://docs.devo.com/space/latest/775225387/Forcepoint%20SWG%20collector"
format: markdown
---
> Macro (toc)

## Overview

Forcepoint secure web gateway services are part of Forcepoint ONE, an all-in-one, cloud-native security platform. Forcepoint ONE SWG enables users to securely access any website or download any document while still enjoying the speed and performance required to stay competitive.

## Devo collector features

| **Feature** | **Details** |
| --- | --- |
| Allow parallel downloading (`multipod`) | `not allowed` |
| Running environments | - `collector server`
- `on-premise` |
| Populated Devo events | `table` |
| Flattening preprocessing | `no` |

## Data sources

|  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| `swgweb logs` | Logs generated from general web traffic from users using the SmartEdge agent, pulls logs from the Analyze > Logs > Web dashboard page. | `/api/bitglassapi/logs/v1/` | `swgweb` | `sse.forcepoint.swgweb.event` | v1.0.0 |
| `access logs` | Logs generated by application activity as seen on the Analyze > Logs > Proxy dashboard page. | `/api/bitglassapi/logs/v1/` | `access` | `sse.forcepoint.access.event` | v1.0.0 |
| `admin logs` | All admin events within the admin portal as seen on the Analyze > Logs > Admin dashboard page. | `/api/bitglassapi/logs/v1/` | `admin` | `sse.forcepoint.admin.event` | v1.0.0 |
| `healthproxy logs` | The Health dashboard allows admins to identify if issues that users encounter are brought on by Forcepoint ONE SSE or the backend server | `/api/bitglassapi/logs/v1/` | `swgweb` | `sse.forcepoint.swgweb.event` | v1.0.0 |

Learn more about these parsers [in this article](https://devodocs.atlassian.net/wiki/spaces/latest/pages/775258125).

## Flattening preprocessing

|  |  |  |  |
| --- | --- | --- | --- |
| **Data source** | **Collector service** | **Optional** | **Flattening details** |
| swgweb logs | `swgweb` | yes | not required |
| access logs | `access` | yes | not required |
| admin logs | `admin` | yes | not required |
| healthproxy logs | `healthproxy` | yes | not required |

## Minimum configuration required for basic pulling

Although this collector supports advanced configuration, the fields required to retrieve data with basic configuration are defined below.

> ℹ️ This minimum configuration refers exclusively to those specific parameters of this integration. There are more required parameters related to the generic behavior of the collector. Check setting sections for details.

| **Setting** | **Details** |
| --- | --- |
| `username` | The username for authentication. |
| `password` | The password for authentication. |

> ℹ️ See the **Accepted authentication methods** section to verify what settings are required based on the desired authentication method.

## Accepted authentication methods

| **Authentication method** | **username** | **password** |
| --- | --- | --- |
| Basic auth | [REQUIRED] | [REQUIRED] |

##  API limits, delays, & known Issues

The API has a limit of 300 requests per day per endpoint.

## Run the collector

Once the data source is configured, you can either send us the required information if you want us to host and manage the collector for you (<u>Cloud collector</u>), or deploy and host the collector in your own machine using a Docker image (<u>On-premise collector</u>).

> Macro (rw-ui-tabs-macro)
> 
> > Macro (rw-tab)
> 
> We use a piece of software called Collector Server to host and manage all our available collectors. If you want us to host this collector for you, [get in touch with us](mailto:support@devo.com) and we will guide you through the configuration.
> 
> > Macro (rw-tab)
> 
> This data collector can be run in any machine that has the Docker service available because it should be executed as a docker container. The following sections explain how to prepare all the required setup for having the data collector running.
> 
> ### Structure
> 
> The following directory structure should be created for being used when running the collector:
> 
> ```
> <any_directory>
> └── devo-collectors/
>     └── <product_name>/
>         ├── certs/
>         │   ├── chain.crt
>         │   ├── <your_domain>.key
>         │   └── <your_domain>.crt
>         ├── state/
>         └── config/ 
>             └── config.yaml 
> ```
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Devo credentials
> 
> In Devo, go to **Administration → Credentials → X.509 Certificates**, download the **Certificate**, **Private key** and **Chain CA** and save them in `<product_name>/certs/`. Learn more about security credentials in Devo [here](#).
> 
> ![image-20240813-101038.png](media://bd6dbe57-df08-4eb8-9c3a-c0058edca1bf)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: false
>   id: not_used
>   name: forcepoint_swg_collector
>   persistence:
>     type: filesystem
>     config:
>       directory_name: state
> 
> outputs:
>   devo_1:
>     type: devo_platform
>     config:
>       address: collector-us.devo.io
>       port: 443
>       type: SSL
>       chain: chain.crt
>       cert: <devo_domain>.crt
>       key: <devo_domain>.key
> 
> inputs:
>   forcepoint_swg:
>     id: <short_unique_id>
>     enabled: true
>     credentials:
>       username: <username>
>       password: <password>
>     services:
>       swgweb:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         override_tag: <optional_override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
>       access:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         override_tag: <optional_override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
>       admin:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         override_tag: <optional_override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
>       healthproxy:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         override_tag: <optional_override_tag_value>
>         request_period_in_seconds: <request_period_in_seconds_value>
> ```
> 
> > ℹ️ All defined service entities will be executed by the collector. If you do not want to run any of them, just remove the entity from the `services` object.
> 
> Replace the placeholders with your required values following the description table below:
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data type** | **Type** | **Value range / Format** | **Details** |
> | `<short_unique_id>` | `int` | Mandatory | Minimum Length 5 | Use this param to give a unique id to this input service.<br>This parameter is used to build the persistence address, do not use the same value for multiple collectors. It could cause a collision. |
> | `<input_status>` | `bool` | Mandatory | false / true | Use this param to enable or disable the given input logic when running the collector. If the value is true, the input will be run. If the value is false, it will be ignored. |
> | `<username>` | `str` | Mandatory | Minimum Length 1 | Username for accessing Forcepoint API |
> | `<password>` | `str` | Mandatory | Minimum Length 1 | Password for accessing Forcepoint API |
> | `<optional_override_tag_value>` | `str` | Optional | A devo tag | This parameter allows defining a custom devo tag. |
> | `<initial_start_time_in_utc_value>` | `str` | Mandatory | UTC format | Start date to pull data from. |
> | `<request_period_in_seconds_value>` | `int` | Mandatory | Minimum length 3 | Time interval for the next pull cycle. Keep this value as **1200** for all the services. |
> 
> ### Download the Docker image
> 
> The collector should be deployed as a Docker container. Download the Docker image of the collector as a .tgz file by clicking the link in the following table:
> 
> | **Collector Docker image** | **SHA-256 hash** |
> | --- | --- |
> | [collector-forcepoint_swg_if-docker-image-1.0.0](https://drive.google.com/file/d/1WhZguHRSLJcLEmmnqqsnbh-UQ6FQDwSk/view?usp=drive_link) | `a8ef251da8f2f1a3496011d3b2b1c09528c6bbb87c6b718b1fcfd6eadd926c42` |
> 
> Use the following command to add the Docker image to the system:
> 
> ```
> gunzip -c <image_file>-<version>.tgz | docker load
> ```
> 
> > ⚠️ Once the Docker image is imported, it will show the real name of the Docker image (including version info). Replace `<image_file>` and `<version>` with a proper value.
> 
> The Docker image can be deployed on the following services:
> 
> #### Docker
> 
> Execute the following command on the root directory `<any_directory>/devo-collectors/<product_name>/`
> 
> ```
> docker run 
> --name collector-<product_name> 
> --volume $PWD/certs:/devo-collector/certs 
> --volume $PWD/config:/devo-collector/config 
> --volume $PWD/state:/devo-collector/state 
> --env CONFIG_FILE=config.yaml 
> --rm 
> --interactive 
> --tty 
> <image_name>:<version>
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.
> 
> #### Docker Compose
> 
> The following Docker Compose file can be used to execute the Docker container. It must be created in the `<any_directory>/devo-collectors/<product_name>/` directory.
> 
> ```
> version: '3'
> services:
>   collector-<product_name>:
>     image: <image_name>:${IMAGE_VERSION:-latest}
>     container_name: collector-<product_name>
>     volumes:
>       - ./certs:/devo-collector/certs
>       - ./config:/devo-collector/config
>       - ./credentials:/devo-collector/credentials
>       - ./state:/devo-collector/state
>     environment:
>       - CONFIG_FILE=${CONFIG_FILE:-config.yaml}
> ```
> 
> To run the container using docker-compose, execute the following command from the `<any_directory>/devo-collectors/<product_name>/` directory:
> 
> ```
> IMAGE_VERSION=<version> docker-compose up -d
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.

## Collector services detail

This section is intended to explain how to proceed with specific actions for services.

### dpim incident

<details>
<summary>Verify data collection</summary>

Once the collector has been launched, it is important to check if the ingestion is performed in a proper way. To do so, go to the collector’s logs console.

This service has the following components:

| **Component** | **Description** |
| --- | --- |
| Setup | The setup module is in charge of authenticating the service and managing the token expiration when needed. |
| Puller | The setup module is in charge of pulling the data in a organized way and delivering the events via SDK. |

#### Setup output

A successful run has the following output messages for the setup module:

```
2024-07-31T08:18:46.267    INFO InputProcess::MainThread -> ForcepointSWGPuller(forcepoint_swg,775754,healthproxy,predefined) Starting the execution of init_variables()
2024-07-31T08:18:46.268    INFO InputProcess::MainThread -> Validating service metadata
2024-07-31T08:18:46.271    INFO InputProcess::MainThread -> Validating defined module definition
2024-07-31T08:18:46.281    INFO InputProcess::MainThread -> Validating common input config
2024-07-31T08:18:46.285    INFO InputProcess::MainThread -> Validating service input config
2024-07-31T08:18:46.287    INFO InputProcess::MainThread -> Running overriding rules
2024-07-31T08:18:46.287    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2024-07-31T08:18:46.288    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2024-07-31T08:18:46.288    INFO InputProcess::MainThread -> Adding raw config to the collector store
2024-07-31T08:18:46.288    INFO InputProcess::MainThread -> Running custom validation rules
2024-07-31T08:18:46.289    INFO InputProcess::MainThread -> ForcepointSWGPuller(forcepoint_swg,775754,healthproxy,predefined) Finalizing the execution of init_variables()
2024-07-31T08:18:46.291    INFO InputProcess::MainThread -> InputThread(forcepoint_swg,775754) - Starting thread (execution_period=60s)
2024-07-31T08:18:46.292    INFO InputProcess::MainThread -> ServiceThread(forcepoint_swg,775754,swgweb,predefined) - Starting thread (execution_period=60s)
2024-07-31T08:18:46.292    INFO InputProcess::MainThread -> ForcepointSWGPullerSetup(unknown,forcepoint_swg#775754,swgweb#predefined) -> Starting thread
2024-07-31T08:18:46.292    INFO InputProcess::MainThread -> ForcepointSWGPuller(forcepoint_swg,775754,swgweb,predefined) - Starting thread
2024-07-31T08:18:46.303 WARNING InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,swgweb,predefined) -> Waiting until setup will be executed
2024-07-31T08:18:46.525    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-07-31T08:18:47.005    INFO InputProcess::ForcepointSWGPullerSetup(unknown,forcepoint_swg#775754,healthproxy#predefined) -> Setup for module <ForcepointSWGPuller> has been successfully executed
```

#### Puller output

A successful initial run has the following output messages for the puller module:

```
024-07-31T08:18:49.341    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,admin,predefined) -> Pull Started
2024-07-31T08:18:49.343    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,admin,predefined) -> Fetching data From : 2024-07-31T08:18:06Z
2024-07-31T08:18:49.607    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,access,predefined) -> Updating the persistence
2024-07-31T08:18:49.615    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,access,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1722413928334):Number of requests made: 1; Number of events received: 1; Number of duplicated events filtered out: 0; Number of events generated and sent: 1; Average of events per second: 0.785.
2024-07-31T08:18:49.616    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,access,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1722413928334):Number of requests made: 1; Number of events received: 1; Number of duplicated events filtered out: 0; Number of events generated and sent: 1; Average of events per second: 0.784.
2024-07-31T08:18:49.616    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,access,predefined) -> The data is up to date!
2024-07-31T08:18:49.617    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,access,predefined) -> Data collection completed. Elapsed time: 1.283 seconds. Waiting for 58.717 second(s) until the next one
2024-07-31T08:18:50.776    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,swgweb,predefined) -> Sent 150 swgweb events to Devo.
```

After a successful collector’s execution (that is, no error logs found), you will see the following log message:

```
2024-07-31T08:19:04.395    INFO InputProcess::ForcepointSWGPuller(forcepoint_swg,775754,swgweb,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1722413929311):Number of requests made: 6; Number of events received: 1475; Number of duplicated events filtered out: 0; Number of events generated and sent: 1475; Average of events per second: 97.856.
```
</details>

<details>
<summary>Restart the persistence</summary>

This collector uses persistent storage to download events in an orderly fashion and avoid duplicates. In case you want to re-ingest historical data or recreate the persistence, you can restart the persistence of this collector by following these steps:

1. Edit the configuration file.
2. Change the value of the `initial_start_time_in_utc_value` parameter to a different one.
3. Save the changes.
4. Restart the collector.

The collector will detect this change and will restart the persistence using the parameters of the configuration file or the default configuration in case it has not been provided.

> ⚠️ Note that this action clears the persistence and cannot be recovered in any way. Resetting persistence could result in duplicate or lost events.
</details>

<details>
<summary>Troubleshooting</summary>

This collector has different security layers that detect both an invalid configuration and abnormal operation. This table will help you detect and resolve the most common errors.

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| **Error type** | **Error ID** | **Error message** | **Cause** | **Solution** |
| `InitVariablesError` | `1` | `initial_start_time_in_utc` is not set as per the `datetime_format : {datetime_format}` | The date in config is not as per required format | Ensure the date format is correct. |
| `InitVariablesError` | `2` | Date {initial_start_time_str} is in the future | The date in config is greater than current time | Ensure the datetime is less than current time |
| `SetupError` | `100` | HTTP Error occurred while retrieving events from Forcepoint server | Wrong credentials or rate limit reached. Check details in the message | Check the credentials and ensure that the collector has the necessary permissions to access the Forcepoint API |
| `SetupError` | `101` | Some error occurred while retrieving events from Forcepoint server. Error details: `{e}` | Check the error message details for the cause. | Contact the developer with exact error message. |
| `PullError` | `300` | HTTP Error occurred while retrieving events from Forcepoint server | Forcepoint API call is failing | Contact the developer with exact error message. |
| `PullError` | `301` | Some error occurred while retrieving events from Forcepoint server. Error details: `{e}` | Forcepoint API call is failing | Contact the developer with exact error message. |
</details>

## Collector operations

To check the memory usage of this collector, look for the following log records in the collector which are displayed every 5 minutes by default, always after running the memory-free process.

- The used memory is displayed by running processes and the sum of both values will give the total used memory for the collector.
- The global pressure of the available memory is displayed in the `global` value.
- All metrics (Global, RSS, VMS) include the value before freeing and after `previous -> after freeing memory`

```
2024-07-12T14:21:03.157    INFO OutputProcess::MainThread -> [GC] global: 92.6% -> 92.7%, process: RSS(41.25MiB -> 41.88MiB), VMS(926.02MiB -> 926.02MiB)
2024-07-12T14:21:03.164    INFO InputProcess::MainThread -> [GC] global: 92.7% -> 92.7%, process: RSS(40.28MiB -> 40.28MiB), VMS(422.00MiB -> 422.00MiB)
```

## Change log

| **Release** | **Released on** | **Release type** | **Details** | **Recommendations** |
| --- | --- | --- | --- | --- |
| `v1.0.0` | 8/12/2024 | [NEW FEATURE] | - | - |