---
title: "Fastly Next-Gen WAF collector"
canonical: "https://docs.devo.com/space/latest/488374507/Fastly%20Next-Gen%20WAF%20collector"
format: markdown
---
> Macro (toc)

## Overview

The Fastly Next-Gen WAF (powered by Signal Sciences) is a web application firewall that monitors for suspicious and anomalous web traffic and protects, in real-time, against attacks directed at the applications and origin servers that you specify.

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

## Data sources

| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| --- | --- | --- | --- | --- | --- |
| List corp activity events | Lists activity events for a corporation. | `api/v0/corps/{corpName}/activity` | `corp_activity_events` | `waf.fastly.nextgen_waf.corp_activity.{corpName}.{site}` | v1.0.0 |
| List site activity events | Lists activity events of a corporation for a given site. | `api/v0/corps/{corpName}/sites/{siteName}/analytics/events` | `site_activity_events` | `waf.fastly.nextgen_waf.site_activity.{corpName}.{site}` | v1.0.0 |
| List corp events. | Lists all events of a corporation for a given site. | `api/v0/corps/{corpName}/sites/{siteName}/events` | `corp_events` | `waf.fastly.nextgen_waf.corp_event.{corpName}.{site}` | v1.0.0 |
| Get request feed. | Lists all of a corporation's request feed data for a given site. | `api/v0/corps/{corpName}/sites/{siteName}/feed/requests` | `feed_requests` | `waf.fastly.nextgen_waf.request_feed.{corpName}.{site}` | v1.0.0 |

For more information on how the events are parsed, [visit our page](https://devodocs.atlassian.net/wiki/spaces/latest/pages/414023696).

## Vendor setup

You must have a Fasly Next-Gen WAF account. For information on how to create an account check [this guide](https://docs.fastly.com/en/ngwaf/start-here).

With the creation of the account you will get:

- User email: The user's email to configure the collector.
- Corporation: It is a necessary parameter to configure the collector. It is provided by the Fastly Next-Gen WAF team during account creation.
- Site: It is a necessary parameter to configure the collector. It is provided by the Fastly Next-Gen WAF team during account creation.

To generate the required API access token, follow these steps:

1. Log in to the Fastly console [here](https://manage.fastly.com/auth/sign-in?returnTo=%2F).
2. From the **My Profile** menu, select API access tokens.
3. Click **Add API** access token.
4. In the **Token** name field, enter a name to identify the access token.
5. Click **Create API access token**.
6. Record the token in a secure location for your use.

> ⚠️ Note that this is the only time the token will be visible. Record the token and keep it secure. For your security, it will not appear in the console.

7. Click **Continue** to finish creating the token.
8. Copy the token to set the collector's `api_token` parameter.

For more information check [this article](https://docs.fastly.com/en/ngwaf/using-our-api).

## 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** |
| --- | --- |
| `user_email` | The username for the Next-Gen WAF API. |
| `api_token` | The API Token for the Next-Gen WAF API.. To find out how to get it, see the Vendor Setup guide. |

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

## Accepted authentication methods

|  |  |
| --- | --- |
| **Authentication method** | **API Token** |
| `user_email` | Required |
| `api_token` | Required |

## 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>).We use a piece of software called Collector Server to host and manage all our available collectors.

To enable the collector for a customer:

1. In the **Collector Server** **GUI**, access the **domain** in which you want this instance to be created
2. Click **Add Collector** and find the one you wish to add.
3. In the **Version** field, select the latest value.
4. In the **Collector Name** field, set the value you prefer (this name must be unique inside the same Collector Server domain).
5. In the sending method select **Direct Send. Direct Send** configuration is optional for collectors that create `Table` events, but mandatory for those that create `Lookups`.
6. In the **Parameters** section, establish the **Collector Parameters** as follows below:

### Editing the JSON configuration

```
{
  "global_overrides": {
    "debug": <debug_status>
  },
  "inputs": {
    "fastly": {
      "id": "<short_unique_id>",
      "corp_name": "<corp_name_value>",
      "site": "<site_value>",
      "enabled": true,
      “environment”: “<environment_value>”,
      "credentials": {
        "user_email": "<user_email_value>",
        “api_token”": "<api_token_value>",
      },
      "services": {
        "corp_activity_events": {
          "request_period_in_seconds": <request_period_in_seconds_value>,
          "override_tag": <override_tag_value>,
          "start_time_utc": <start_time_in_utc_value>
        },
        "site_activity_events": {
          "request_period_in_seconds": <request_period_in_seconds_value>,
          "override_tag": <override_tag_value>,
          "start_time_utc": <start_time_in_utc_value>
        },
        "corp_events": {
          "request_period_in_seconds": <request_period_in_seconds_value>,
          "override_tag": <override_tag_value>,
          "start_time_utc": <start_time_in_utc_value>
        },
        "feed_requests": {
          "request_period_in_seconds": <request_period_in_seconds_value>,
          "override_tag": <override_tag_value>,
          "start_time_utc": <start_time_in_utc_value>
        },
      }
    }
  }
}
```

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| **Parameter** | **Data type** | **Type** | **Value Range** | **Details** |
| `collector_name` | `str` | Mandatory | Minimum length: 1 | Use this param to give a name to this collector. |
| `devo_address` | `str` | Mandatory | [collector-us.devo.io](http://collector-us.devo.io)<br>[collector-eu.devo.io](http://collector-eu.devo.io) | Use this parameter to identify the Devo Cloud where the events will be sent. |
| `chain_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the chain.cert file downloaded from your Devo domain. Usually this file's name is: chain.crt. |
| `cert_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.cert downloaded from your Devo domain. |
| `key_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.key downloaded from your Devo domain. |
| `short_unique_id` | `int` | Mandatory | Minimum length: 1<br>Maximum length: 5 | Use this param to give an 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. |
| `corp_name_value` | `int` | Mandatory | Minimum length: 1 | The corporation for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
| `site_value` | `int` | Mandatory | Minimum length: 1 | The site for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
| `environment_value` | `str` | Optional | Minimum length: 1 | This is an optional control parameter that is injected into the events and allows to differentiate the environment. For example: dev and prod.<br>> ℹ️ This parameter should be removed if it is not used. |
| `user_email_value` | `str` | Mandatory | Minimum length: 1 | The user email for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
| `api_token_value` | `str` | Mandatory | Minimum length: 1 | The api_token for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
| `override_tag_value` | `str` | Optional | Devo tag-friendly string (no special characters, spaces, etc.) For more information see <u>[Devo Tags](https://docs.devo.com/space/latest/95126204/About%20Devo%20tags)</u>. | An optional tag that allows users to override the service default tags.<br>> ℹ️ This parameter can be removed or commented. |
| `start_time_utc_value` | `str` | Optional | UTC datetime string having datetime string format %Y-%m-%dT%H:%M:%SZ<br>(e.g., “2023-07-11T01:23:01Z”)<br>> ℹ️ Must be within 24 hours to 5 minutes in past for feed_requests servcie. | This configuration allows you to set a custom date as the beginning of the period to download. This allows downloading historical data (one month back for example) before downloading new events.<br>> ℹ️ This parameter should be removed if it is not used. |
| `request_period_in_seconds_value` | `int` | Optional | minimum length: 1 | Period in seconds used between each data pulling. This value will overwrite the default value (60 seconds).<br>> ℹ️ This parameter can be removed or commented. |

> 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.
> 
> To enable the collector for a customer:
> 
> 1. In the **Collector Server** **GUI**, access the **domain** in which you want this instance to be created
> 2. Click **Add Collector** and find the one you wish to add.
> 3. In the **Version** field, select the latest value.
> 4. In the **Collector Name** field, set the value you prefer (this name must be unique inside the same Collector Server domain).
> 5. In the sending method select **Direct Send. Direct Send** configuration is optional for collectors that create `Table` events, but mandatory for those that create `Lookups`.
> 6. In the **Parameters** section, establish the **Collector Parameters** as follows below:
> 
> ### Editing the JSON configuration
> 
> ```
> {
>   "global_overrides": {
>     "debug": <debug_status>
>   },
>   "inputs": {
>     "fastly": {
>       "id": "<short_unique_id>",
>       "corp_name": "<corp_name_value>",
>       "site": "<site_value>",
>       "enabled": true,
>       “environment”: “<environment_value>”,
>       "credentials": {
>         "user_email": "<user_email_value>",
>         “api_token”": "<api_token_value>",
>       },
>       "services": {
>         "corp_activity_events": {
>           "request_period_in_seconds": <request_period_in_seconds_value>,
>           "override_tag": <override_tag_value>,
>           "start_time_utc": <start_time_in_utc_value>
>         },
>         "site_activity_events": {
>           "request_period_in_seconds": <request_period_in_seconds_value>,
>           "override_tag": <override_tag_value>,
>           "start_time_utc": <start_time_in_utc_value>
>         },
>         "corp_events": {
>           "request_period_in_seconds": <request_period_in_seconds_value>,
>           "override_tag": <override_tag_value>,
>           "start_time_utc": <start_time_in_utc_value>
>         },
>         "feed_requests": {
>           "request_period_in_seconds": <request_period_in_seconds_value>,
>           "override_tag": <override_tag_value>,
>           "start_time_utc": <start_time_in_utc_value>
>         },
>       }
>     }
>   }
> }
> ```
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data type** | **Type** | **Value Range** | **Details** |
> | `collector_name` | `str` | Mandatory | Minimum length: 1 | Use this param to give a name to this collector. |
> | `devo_address` | `str` | Mandatory | [collector-us.devo.io](http://collector-us.devo.io)<br>[collector-eu.devo.io](http://collector-eu.devo.io) | Use this parameter to identify the Devo Cloud where the events will be sent. |
> | `chain_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the chain.cert file downloaded from your Devo domain. Usually this file's name is: chain.crt. |
> | `cert_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.cert downloaded from your Devo domain. |
> | `key_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.key downloaded from your Devo domain. |
> | `short_unique_id` | `int` | Mandatory | Minimum length: 1<br>Maximum length: 5 | Use this param to give an 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. |
> | `corp_name_value` | `int` | Mandatory | Minimum length: 1 | The corporation for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
> | `site_value` | `int` | Mandatory | Minimum length: 1 | The site for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
> | `environment_value` | `str` | Optional | Minimum length: 1 | This is an optional control parameter that is injected into the events and allows to differentiate the environment. For example: dev and prod.<br>> ℹ️ This parameter should be removed if it is not used. |
> | `user_email_value` | `str` | Mandatory | Minimum length: 1 | The user email for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
> | `api_token_value` | `str` | Mandatory | Minimum length: 1 | The api_token for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
> | `override_tag_value` | `str` | Optional | Devo tag-friendly string (no special characters, spaces, etc.) For more information see <u>[Devo Tags](https://docs.devo.com/space/latest/95126204/About%20Devo%20tags)</u>. | An optional tag that allows users to override the service default tags.<br>> ℹ️ This parameter can be removed or commented. |
> | `start_time_utc_value` | `str` | Optional | UTC datetime string having datetime string format %Y-%m-%dT%H:%M:%SZ<br>(e.g., “2023-07-11T01:23:01Z”)<br>> ℹ️ Must be within 24 hours to 5 minutes in past for feed_requests servcie. | This configuration allows you to set a custom date as the beginning of the period to download. This allows downloading historical data (one month back for example) before downloading new events.<br>> ℹ️ This parameter should be removed if it is not used. |
> | `request_period_in_seconds_value` | `int` | Optional | minimum length: 1 | Period in seconds used between each data pulling. This value will overwrite the default value (60 seconds).<br>> ℹ️ This parameter can be removed or commented. |
> 
> > 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-20240205-105224.png](media://338f3678-a52b-4897-8111-2064187d5dc8)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: false
>   id: not_used
>   name: <collector_name>
>   persistence:
>     type: filesystem
>     config:
>       directory_name: state
> outputs:
>   devo_1:
>     type: devo_platform
>     config:
>       address: <devo_address>
>       port: 443
>       type: SSL
>       chain: <chain_filename>
>       cert: <cert_filename>
>       key: <key_filename>
> inputs:
>   fastly:
>     id: <short_unique_id>
>     enabled: true
>     environment:: <environment_value>
>     corp_name: <corp_name_value>
>     site: <site_value>
>     credentials:
>       user_email: <user_email_value>
>       api_token: <api_token_value>
>     services:
>       corp_activity_events:
>         request_period_in_seconds: <request_period_in_seconds_value>
>         override_tag: <override_tag_value>
>         start_time_utc: <start_time_in_utc_value>
>       site_activity_events:
>         request_period_in_seconds: <request_period_in_seconds_value>
>         override_tag: <override_tag_value>
>         start_time_utc: <start_time_in_utc_value>
>       corp_events:
>         request_period_in_seconds: <request_period_in_seconds_value>
>         override_tag: <override_tag_value>
>         start_time_utc: <start_time_in_utc_value>
>       feed_requests::
>         request_period_in_seconds: <request_period_in_seconds_value>
>         override_tag: <override_tag_value>
>         start_time_utc: <start_time_in_utc_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** | **Details** |
> | `collector_name` | `str` | Mandatory | Minimum length: 1 | Use this param to give a name to this collector. |
> | `devo_address` | `str` | Mandatory | [collector-us.devo.io](http://collector-us.devo.io)<br>[collector-eu.devo.io](http://collector-eu.devo.io) | Use this parameter to identify the Devo Cloud where the events will be sent. |
> | `chain_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the chain.cert file downloaded from your Devo domain. Usually this file's name is: chain.crt. |
> | `cert_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.cert downloaded from your Devo domain. |
> | `key_filename` | `str` | Mandatory | minimum length: 4<br>maximum length: 20 | Use this parameter to identify the file.key downloaded from your Devo domain. |
> | `short_unique_id` | `int` | Mandatory | Minimum length: 1<br>Maximum length: 5 | Use this param to give an 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. |
> | `corp_name_value` | `int` | Mandatory | Minimum length: 1 | The corporation for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
> | `site_value` | `int` | Mandatory | Minimum length: 1 | The site for the Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**.. |
> | `environment_value` | `str` | Optional | Minimum length: 1 | This is an optional control parameter that is injected into the events and allows to differentiate the environment. For example: dev and prod.<br>> ℹ️ This parameter should be removed if it is not used. |
> | `user_email_value` | `str` | Mandatory | Minimum length: 1 | The user email for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
> | `api_token_value` | `str` | Mandatory | Minimum length: 1 | The api_token for the  Next-Gen WAF API. To find out how to get it, see the **Vendor Setup guide**. |
> | `override_tag_value` | `str` | Optional | Devo tag-friendly string (no special characters, spaces, etc.) For more information see <u>[Devo Tags](https://docs.devo.com/space/latest/95126204/About%20Devo%20tags)</u>. | An optional tag that allows users to override the service default tags.<br>> ℹ️ This parameter can be removed or commented. |
> | `start_time_utc_value` | `str` | Optional | UTC datetime string having datetime string format %Y-%m-%dT%H:%M:%SZ<br>(e.g., “2023-07-11T01:23:01Z”)<br>> ℹ️ Must be within 24 hours to 5 minutes in past for feed_requests servcie. | This configuration allows you to set a custom date as the beginning of the period to download. This allows downloading historical data (one month back for example) before downloading new events.<br>> ℹ️ This parameter should be removed if it is not used. |
> | `request_period_in_seconds_value` | `int` | Optional | minimum length: 1 | Period in seconds used between each data pulling. This value will overwrite the default value (300 seconds).<br>> ℹ️ This parameter can be removed or commented. |
> 
> ### 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-fastly_nextgen_waf_if-docker-image-1.4.0](https://drive.google.com/file/d/1sDU4UJV4O_eGPLUkISIO0hRkWRc-hpsL/view?usp=drive_link) | `77d9105a5d77d456ae3299128108fcd4e34ce4c530e223057e7bd6a2c025d8db` |
> 
> 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.

### Events service

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

#### Internal process and deduplication method

Data is collected by setting a start date and by pagination. To eliminate duplicates, the date of the last event sent to Devo and the IDs of events with the same date are stored.

#### Devo categorization and destination

All events of this service are ingested into the table `waf.fastly.nextgen_waf.request_feed.{corpName}.{site}`

#### Setup output

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

```
INFO InputProcess::MainThread -> ServiceThread(fastly,1234123,corp_activity_events,predefined) - Starting thread (execution_period=60s)
INFO InputProcess::MainThread -> FastlyPullerSetup(fastly_collector,fastly#1234123,corp_activity_events#predefined) -> Starting thread
WARNING InputProcess::FastlyPullerSetup(fastly_collector,fastly#1234123,corp_activity_events#predefined) -> The token/header/authentication has not been created yet
INFO InputProcess::FastlyPullerSetup(fastly_collector,fastly#1234123,corp_activity_events#predefined) -> Setup for module <FastlyEventsPuller> has been successfully executed
```

#### Puller output

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

```
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) Starting the execution of pre_pull()
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Reading persisted data
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Data retrieved from the persistence: None
WARNING InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Persistence will be overridden due to the retrieved state is empty
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Running the persistence upgrade steps
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Running the persistence corrections steps
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Running the persistence corrections steps
WARNING InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Some changes have been detected and the persistence needs to be updated. Previous content: None. New content: {'@persistence_version': 1, 'start_time_epoch': 1673400180, 'last_event_time_epoch': 1673400180, 'last_id': None}
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Updating the persistence
WARNING InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Persistence has been updated successfully
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) Finalizing the execution of pre_pull()
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Starting data collection every 60 seconds
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Pull Started
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1700122878630):Number of requests made: 1; Number of events received: 13; Number of duplicated events filtered out: 0; Number of events generated and sent: 13; Average of events per second: 6.338.
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1700122878630):Number of requests made: 1; Number of events received: 13; Number of duplicated events filtered out: 0; Number of events generated and sent: 13; Average of events per second: 6.336.
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> The data is up to date!
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Data collection completed. Elapsed time: 2.070 seconds. Waiting for 57.930 second(s) until the next one
```

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

```
INFO InputProcess::FastlyEventsPuller(fastly,1234123,corp_activity_events,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1700122878630):Number of requests made: 1; Number of events received: 13; Number of duplicated events filtered out: 0; Number of events generated and sent: 13; Average of events per second: 6.336.
```
</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 `start_time_utc` 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.
</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 | Invalid start_time_utc: {datetime_utc_now}. Must be in the past. | The user has set the start_time_utc parameter in the future | Set the start_time_utc parameter to a date and time earlier than the current one in the configuration file. |
| 2 | Invalid start_time_utc: {datetime_utc_now}. The maximum value is 24 hours and 5 minutes in the past (in utc time). | The user has set the start_time_utc parameter out of range. | Set the start_time_utc parameter within the indicated range. |
| SetupError | 102 | ERROR: The base url is invalid. Cause: {cause} | The url is malformed because you have entered an invalid corporation or site value. | Check if the corporation and site values are correct. |
| ApiError | 400 | HTTP ERROR 400: Bad request: The server could not understand the request. | The API request is malformed. | Contact the Devo team |
| 401 | HTTP ERROR 401:                         Unauthorized: Authentication is required and has failed or has not been provided. | The user is not authorized to access the requested service. | Check the permissions and that the credentials are not expired. |
| 402 | HTTP ERROR 500: Server Error: An error occurred on the server. | Unknown server error. | Check that the internet connection works correctly and contact the company that manages the server on which the events are hosted. |
| 403 | Request Error: Received status code {status_code} | Unknown API error | Contact the Devo team. |
| 404 | HTTP ERROR 429: Too Many Requests: The user has sent too many requests in a given amount of time. | Too many requests have been sent to the resource. | Check:<br>- That there is only one POD running.<br>- That there are no more computers using the same credentials<br>Wait several minutes before restarting the collector.<br>If nothing works, contact the Devo team. |
</details>

## Collector operations

This section is intended to explain how to proceed with specific operations of this collector.

<details>
<summary>Verify collector operations</summary>

### Initialization

The initialization module is in charge of setup and running the input (pulling logic) and output (delivering logic) services and validating the given configuration.

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

```
2023-01-10T15:22:57.146    INFO MainProcess::MainThread -> Loading configuration using the following files: {"full_config": "config.yaml", "job_config_loc": null, "collector_config_loc": null}
2023-01-10T15:22:57.146    INFO MainProcess::MainThread -> Using the default location for "job_config_loc" file: "/etc/devo/job/job_config.json"
2023-01-10T15:22:57.147    INFO MainProcess::MainThread -> "\etc\devo\job" does not exists
2023-01-10T15:22:57.147    INFO MainProcess::MainThread -> Using the default location for "collector_config_loc" file: "/etc/devo/collector/collector_config.json"
2023-01-10T15:22:57.148    INFO MainProcess::MainThread -> "\etc\devo\collector" does not exists
2023-01-10T15:22:57.148    INFO MainProcess::MainThread -> Results of validation of config files parameters: {"config": "config.yaml", "config_validated": True, "job_config_loc": "/etc/devo/job/job_config.json", "job_config_loc_default": True, "job_config_loc_validated": False, "collector_config_loc": "/etc/devo/collector/collector_config.json", "collector_config_loc_default": True, "collector_config_loc_validated": False}
2023-01-10T15:22:57.171 WARNING MainProcess::MainThread -> [WARNING] Illegal global setting has been ignored -> multiprocessing: False
```

### Events delivery and Devo ingestion

The event delivery module is in charge of receiving the events from the internal queues where all events are injected by the pullers and delivering them using the selected compatible delivery method.

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

```
2023-01-10T15:23:00.788    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2023-01-10T15:23:00.789    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(standard_senders,devo_1) -> Starting thread (every 300 seconds)
2023-01-10T15:23:00.790    INFO OutputProcess::MainThread -> DevoSenderManager(standard_senders,manager,devo_1) -> Starting thread
2023-01-10T15:23:00.842    INFO OutputProcess::MainThread -> global_status: {"output_process": {"process_id": 18804, "process_status": "running", "thread_counter": 21, "thread_names": ["MainThread", "pydevd.Writer", "pydevd.Reader", "pydevd.CommandThread", "pydevd.CheckAliveThread", "DevoSender(standard_senders,devo_sender_0)", "DevoSenderManagerMonitor(standard_senders,devo_1)", "DevoSenderManager(standard_senders,manager,devo_1)", "OutputStandardConsumer(standard_senders_consumer_0)",
```

#### Sender services

The Integrations Factory Collector SDK has 3 different senders services depending on the event type to delivery (`internal`, `standard`, and `lookup`). This collector uses the following Sender Services:

| **Sender services** | **Description** |
| --- | --- |
| `internal_senders` | In charge of delivering internal metrics to Devo such as logging traces or metrics. |
| `standard_senders` | In charge of delivering pulled events to Devo. |

#### Sender statistics

Each service displays its own performance statistics that allow checking how many events have been delivered to Devo by type:

| **Logging trace** | **Description** |
| --- | --- |
| `Number of available senders: 1` | Displays the number of concurrent senders available for the given Sender Service. |
| `sender manager internal queue size: 0` | Displays the items available in the internal sender queue.<br>> ℹ️ This value helps detect bottlenecks and needs to increase the performance of data delivery to Devo. This last can be made by increasing the concurrent senders. |
| `Total number of messages sent: 44, messages sent since "2022-06-28 10:39:22.511671+00:00": 21 (elapsed 0.007 seconds)` | Displayes the number of events from the last time and following the given example, the following conclusions can be obtained:<br>- 44 events were sent to Devo since the collector started.
- The last checkpoint timestamp was `2022-06-28 10:39:22.511671+00:00`.
- 21 events where sent to Devo between the last UTC checkpoint and now.
- Those 21 events required `0.007 seconds` to be delivered.<br>> ℹ️ By default these traces will be shown every 10 minutes. |
</details>

<details>
<summary>Check memory usage</summary>

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`

```
INFO InputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(34.50MiB -> 34.08MiB), VMS(410.52MiB -> 410.02MiB)
INFO OutputProcess::MainThread -> [GC] global: 20.4% -> 20.4%, process: RSS(28.41MiB -> 28.41MiB), VMS(705.28MiB -> 705.28MiB)
```
</details>

## Change log

| **Release** | **Released on** | **Release type** | **Details** | **Recommendations** |
| --- | --- | --- | --- | --- |
| `v1.4.0` | 6/3/2025 | [IMPROVEMENTS] | **Improvements**<br>- The DCSDK Docker base image has been updated to "1.5.1"
- The DevoCollectorSDK Python package (devo-collector-sdk) has been updated  to "1.16.2" | `Recommended Version` |
| `v1.2.0` | 4/7/2025 | [FIXES]<br>[IMPROVEMENTS] | - Fixed init variable issue.
- Upgraded DCSDK from 1.12.4 to 1.15.0 | `Update` |
| `v1.1.0` | 8/26/2024 | [IMPROVEMENTS] | - Added a buffer to protect the collector when too many messages fill the memory. Events are sent in batches of 30000.
- Upgraded DCSDK from 1.10.2 to 1.12.4 | `Update` |
| `v1.0.0` | 10/10/2023 | [INITIAL RELEASE] | Deployed the first Beta version of the Fastly Next-Gen WAF with the following services:<br>- List corp activity events.<br>- List site activity events.<br>- List corp events.<br>- Get request feed.<br>- DCSDK Version: 1.10.0 | `Update` |