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

## Configuration requirements

To run this collector, there are some configurations detailed below that you need to consider.

| **Configuration** | **Details** |
| --- | --- |
| API Key | You will need to create API Key to set up this collector. |
| CompanyID | You will need to have your company_id given by SOCRadar. |

> ℹ️ **More information**
> ℹ️ 
> ℹ️ Refer to the [Vendor setup ](#vendorsetup)section to know more about these configurations.

## Overview

SOCRadar is a cloud-based, **AI-powered Digital Risk Protection Platform** enhanced by cyber threat intelligence capabilities.

## Devo collector features

| **Feature** | **Details** |
| --- | --- |
| Allow parallel downloading (`multipod`) | `Allowed` |
| Running environments | `Collector server`<br>`On-premise` |
| Populated Devo events | `Table`<br>`Lookups` |
| Flattening preprocessing | `No` |

## Data sources

| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| --- | --- | --- | --- | --- | --- |
| Incidents | SOCRadar incidents | `/company/{company_id}/incidents/v2` | incidents | `threatintel.socradar.xti.incidents.1.json` | v1.0 |
| Audit logs | SOCRadar audit events | `/company/{company_id}/auditlogs` | audit_logs | `threatintel.socradar.xti.audit_logs.1.json` | v1.0 |
| Threat feeds | SOCRadar threat feed entries | `/threat/intelligence/socradar_collections` | threat_feed | Lookups:<br>`socradar_threat_intelligence_urls`<br>`socradar_threat_intelligence_hashes`<br>`socradar_threat_intelligence_domains`<br>`socradar_threat_intelligence_ips` | v1.0 |

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

## Flattening preprocessing

| **Data source** | **Collector service** | **Optional** |
| --- | --- | --- |
| Incidents | incidents | `No` |
| Audit logs | audit_logs | `No` |
| Threat feeds | threat_feed | `No` |

> Macro (anchor)



## Vendor setup

There are some requirements to set up this collector, you will need to have an API key and create a Token.  Follow the steps below:

1. Log into the [SOCRadar portal](https://platform.socradar.com/login?next=%2F).
2. Navigate to the **API Options** tab.
3. Generate a new API Key using the **Actions** button under the API keys section.

## 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** |
| --- | --- |
| api_key | The API key from SOCRADAR. |
| company_id | The company identification gien by SOCRadar. |

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

## Accepted authentication methods

| **Authentication method** | **api_key** | **company_id** |
| --- | --- | --- |
| api_key/company_id | [REQUIRED] | [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>).

> 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": false
>   },
>   "inputs": {
>     "socradar": {
>       "id": "<input_id>",
>       "enabled": true,
>       "credentials": {
>         "api_key": "<api_key>",
>         "company_id": "<company_id>"
>       },
>       "requests_limits": [
>         {
>           "period": "1m",
>           "number_of_requests": "<request_per_minute>"
>         }
>       ],
>       "services": {
>         "incidents": {
>           "tag": "<tag>",
>           "initial_start_time_in_utc": "<initial_start_time_in_utc>"
>         },
>         "audit_logs": {
>           "tag": "<tag>",
>           "initial_start_time_in_utc": "<initial_start_time_in_utc>"
>         },
>         "threat_feed": {
>           "initial_start_time_in_utc": "<initial_start_time_in_utc>",
>           "collections": [
>             {
>               "IP": {
>                 "lookup_name": "<socradar_custom_lookup_name>",
>                 "include_collections": [],
>                 "exclude_collections": []
>               }
>             },
>             {
>               "Domain": {
>                 "lookup_name": "<socradar_custom_lookup_name>",
>                 "include_collections": [],
>                 "exclude_collections": []
>               }
>             },
>             {
>               "URL": {
>                 "lookup_name": "<socradar_custom_lookup_name>",
>                 "include_collections": [],
>                 "exclude_collections": []
>               }
>             },
>             {
>               "Hash": {
>                 "lookup_name": "<socradar_custom_lookup_name>",
>                 "include_collections": [],
>                 "exclude_collections": []
>               }
>             }
>           ]
>         }
>       }
>     }
>   }
> }
> ```
> 
> > ℹ️ 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.
> 
> Please replace the placeholders with real world values following the description table below:
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data Type** | **Type** | **Value Range / Format** | **Details** |
> | `debug_status` | `bool` | `Mandatory` | `false` / `true` | If the value is `true`, the debug logging traces will be enabled when running the collector. If the value is `false`, only the `info`, `warning` and `error` logging levels will be printed. |
> | `input_id` | int | mandatory | minimum length: 1<br>maximum length: 5 | Use this parameter 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. |
> | `api_key` | str | mandatory |  | The key obtained from SOCRadar for authentication. |
> | `company_id` | str | mandatory |  | A company identification given by SOCRadar. |
> | `request_per_minute` | int | mandatory |  | A rate limit value. A value of -1 means no restriction (not recommended).<br>A typical value is 4 or 16, depending of the contracted plan with SOCRadar.   
> See “**API limitations**” section. |
> | `initial_start_time_in_utc` | str | optional | UTC datetime string | 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. |
> | `tag` | str | optional | Devo tag-friendly string (no special characters, spaces, etc.) | An optional tag that allows users to override the service default tags. (see predefined tag names above) |
> | `socradar_custom_lookup_name` | str | optional | Valid name for a lookup (no special characters, no spaces) | Optional name for the lookup.. See the predefinied list of names above. |
> 
> ![10_servicenow.png](media://33672d4c-fecc-40ab-9d16-bd708adcff31)
> 
> > 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](media://e3f913ab-8736-4812-a0bc-b056182b95a7)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: <debug_status>
>   id: <collector_id>
>   name: <collector_name>
>   persistence:
>     type: filesystem
>     config:
>       directory_name: state
> outputs:
>   devo_us_1:
>     type: devo_platform
>     config:
>       address: <devo_address>
>       port: 443
>       type: SSL
>       chain: <chain_filename>
>       cert: <cert_filename>
>       key: <key_filename>
> inputs:
>   socradar:
>     id: <input_id>
>     enabled: true
>     credentials:
>       api_key: <api_key>
>       company_id: <company_id>
>     requests_limits:
>       - period: 1m
>         number_of_requests: <request_per_minute>
>     services:
>       incidents:
>         tag: <tag>
>         initial_start_time_in_utc: <initial_start_time_in_utc>
>       audit_logs:
>         tag: <tag>
>         initial_start_time_in_utc: <initial_start_time_in_utc>
>       threat_feed:
>         initial_start_time_in_utc: <initial_start_time_in_utc>
>         collections:
>           - IP:
>               lookup_name: <socradar_custom_lookup_name>
>               include_collections: []
>               exclude_collections: []
>           - Domain:
>               lookup_name: <socradar_custom_lookup_name>
>               include_collections: [ ]
>               exclude_collections: [ ]
>           - URL:
>               lookup_name: <socradar_custom_lookup_name>
>               include_collections: [ ]
>               exclude_collections: [ ]
>           - Hash:
>               lookup_name: <socradar_custom_lookup_name>
>               include_collections: [ ]
>               exclude_collections: [ ]
> ```
> 
> > ℹ️ 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** |
> | --- | --- | --- | --- | --- |
> | `<debug_status>` | `bool` | `Mandatory` | `false` / `true` | This will make the collector generate (or not) log messages with the DEBUG level. |
> | `collector_id` | int | mandatory | minimum length: 1<br>maximum length: 5 | Use this parameter to give a unique ID to this collector. |
> | `collector_name` | str | mandatory | minimum length: 1<br>maximum length: 10 | Use this parameter to give a valid name to this collector. |
> | `devo_address` | str | mandatory | `collector-us.devo.io`<br>`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. |
> | `input_id` | int | mandatory | minimum length: 1<br>maximum length: 5 | Use this parameter 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. |
> | `api_key` | str | mandatory |  | The key obtained from SOCRadar for authentication. |
> | `company_id` | str | mandatory |  | A company identification given by SOCRadar. |
> | `request_per_minute` | int | mandatory |  | A rate limit value. A value of -1 means no restriction (not recommended).<br>A typical value is 4 or 16, depending of the contracted plan with SOCRadar.   
> See “**API limitations**” section. |
> | `initial_start_time_in_utc` | str | optional | UTC datetime string | 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. |
> | `tag` | str | optional | Devo tag-friendly string (no special characters, spaces, etc.) | An optional tag that allows users to override the service default tags. (see predefined tag names above) |
> | `socradar_custom_lookup_name` | str | optional | Valid name for a lookup (no special characters, no spaces) | Optional name for the lookup.. See the predefinied list of names above. |
> 
> ### 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-socradar_collector_if-docker-image-1.0.0](https://drive.google.com/uc?export=download&id=1uGtQKQErrSxP54pRRfCWjrYvIBnqaTRl) | `1229be45c902464f4d9e64270f000f0f1ee0d1e68feb481a487d9c38ace3c1a6` |
> 
> 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.

## API limitations

SOCRadar collector has some API limitations according to the contract. 

![image](media://17df5608-55c6-477c-9fe6-da7493441537)

This value should be introduced in the `request_per_minute` value described above.

If this limit is exceeded, a 429 error is returned by the SOCRadar API. In the event the collector encounters a `429` (that is, the requests hit a rate limit), the collector will attempt to gracefully respect the `429` rate limit and re-attempt the request three times before failing.

> ℹ️ The value of 4 request for minute seems too low for the collector to run with all the services enabled. Change the configuration to disable some services.

## 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>

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:

```
INFO InputProcess::SOCRadarPullerSetup(SOCRadar_collector,socradar#17812,audit_logs#predefined) -> Testing access to SOCRadar API for audit_logs
INFO InputProcess::SOCRadarPullerSetup(SOCRadar_collector,socradar#17812,audit_logs#predefined) -> Access to SOCRadar is OK
INFO InputProcess::SOCRadarPullerSetup(SOCRadar_collector,socradar#17812,audit_logs#predefined) -> Setup for module <SOCRadarPuller> has been successfully executed
```

#### Puller output

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

> ℹ️ Note that the `PrePull` action is executed only one time before the first run of the `Pull` action.

```
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Detected initial start time in UTC change: {'type_changes': {'root': {'old_type': <class 'pendulum.datetime.DateTime'>, 'new_type': <class 'NoneType'>, 'old_value': DateTime(2023, 1, 20, 0, 0, 0, tzinfo=Timezone('UTC')), 'new_value': None}}}. Setting last run time to 2023-01-20T00:00:00+00:00
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,IP) -> [pre_pull] -> Creating a new lookup_job_factory to be used by the pull method
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,IP) -> Detected initial start time in UTC change: {'type_changes': {'root': {'old_type': <class 'pendulum.datetime.DateTime'>, 'new_type': <class 'NoneType'>, 'old_value': DateTime(2023, 1, 20, 0, 0, 0, tzinfo=Timezone('UTC')), 'new_value': None}}}. Setting last run time to 2023-01-20T00:00:00+00:00
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Starting data collection every 60 seconds
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,IP) -> Starting data collection every 3600 seconds
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Domain) -> [pre_pull] -> Creating a new lookup_job_factory to be used by the pull method
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,URL) -> [pre_pull] -> Creating a new lookup_job_factory to be used by the pull method
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Domain) -> Detected initial start time in UTC change: {'type_changes': {'root': {'old_type': <class 'pendulum.datetime.DateTime'>, 'new_type': <class 'NoneType'>, 'old_value': DateTime(2023, 1, 20, 0, 0, 0, tzinfo=Timezone('UTC')), 'new_value': None}}}. Setting last run time to 2023-01-20T00:00:00+00:00
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Retrieving audit_logs events since 2023-01-20T00:00:00+00:00 to 2023-01-25 12:05:14.444890+00:00
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,URL) -> Detected initial start time in UTC change: {'type_changes': {'root': {'old_type': <class 'pendulum.datetime.DateTime'>, 'new_type': <class 'NoneType'>, 'old_value': DateTime(2023, 1, 20, 0, 0, 0, tzinfo=Timezone('UTC')), 'new_value': None}}}. Setting last run time to 2023-01-20T00:00:00+00:00
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,IP) -> Retrieving threat_feed events
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Query range exceeds 1 day. Chunking into 6 query windows
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Hash) -> [pre_pull] -> Creating a new lookup_job_factory to be used by the pull method
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Domain) -> Starting data collection every 3600 seconds
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,IP) -> Retrieving IP indicators from SOCRadar
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,URL) -> Starting data collection every 3600 seconds
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Querying window 1 of 6 (2023-01-20T00:00:00+00:00 - 2023-01-20T23:59:59.999999+00:00)
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Hash) -> Detected initial start time in UTC change: {'type_changes': {'root': {'old_type': <class 'pendulum.datetime.DateTime'>, 'new_type': <class 'NoneType'>, 'old_value': DateTime(2023, 1, 20, 0, 0, 0, tzinfo=Timezone('UTC')), 'new_value': None}}}. Setting last run time to 2023-01-20T00:00:00+00:00
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Domain) -> Retrieving threat_feed events
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,URL) -> Retrieving threat_feed events
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Domain) -> Retrieving Domain indicators from SOCRadar
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Hash) -> Starting data collection every 3600 seconds
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,URL) -> Retrieving URL indicators from SOCRadar
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Hash) -> Retrieving threat_feed events
INFO InputProcess::SOCRadarThreatIntelligencePuller(socradar,17812,threat_feed,predefined,Hash) -> Retrieving Hash indicators from SOCRadar
```

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

```
INFO InputProcess::SOCRadarPuller(socradar,17812,audit_logs,predefined) -> Retrieving audit_logs events since 2023-01-25T13:05:14.546952+00:00 to 2023-01-25 13:06:14.547341+00:00
```

> ℹ️ The value `@devo_pulling_id` is injected in each event to group all events ingested by the same pull action. You can use it to get the exact events downloaded in that `Pull` action in Devo’s search window.
</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` 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** |
| --- | --- | --- | --- | --- |
| SetupError | 101 | `Error during auth check. Please doublecheck your credentials: [..]` | SOCRadar reject the credentials. | Obtain new api_key from SOCRadar. |
| InitVariablesError | 1 | `Error while fetching collector variables: [..]` | One of required parameters is absent or a parameter has an incorrect type | Add the parameter or correct the type. |
| 2 | `Error validating collector variables: [...]` | One of the parameters has the correct type but it is not correct.<br>For instance, a date is not a valid date, or a number is out of its range. | Correct the parameter in the configuration file. |
| 3 | `Error while creating client: [..]` | Other error inizializing the collector. | Solution depends on specific error message. |
| Prepull Error | 200 | `Error during pre_pull: [...]` | Something was wrong creating the checkpoints | Review the `initial_start_time_in_utc` |
| Pull Error | 300 | `Encountered pull error: [...]` | Something was wrong contacting the API. | Read the HTTP error code as long as the response’s text. This information should be enough to understand why is the error happening. |
</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-25T12:54:13.419    INFO MainProcess::MainThread -> Loading configuration using the following files: {"full_config": "config.yaml", "job_config_loc": null, "collector_config_loc": null}
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> List of files in directory "/devo-collector/config": []
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Using the default location for "job_config_loc" file: "/etc/devo/job/job_config.json"
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Using the default location for "collector_config_loc" file: "/etc/devo/collector/collector_config.json"
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Results of validation of config files parameters: {"config": "/devo-collector/config/config.yaml", "config_validated": False, "job_config_loc": "/etc/devo/job/job_config.json", "job_config_loc_default": True, "job_config_loc_validated": True, "collector_config_loc": "/etc/devo/collector/collector_config.json", "collector_config_loc_default": True, "collector_config_loc_validated": True}
2023-01-25T12:54:13.436    INFO MainProcess::MainThread -> Build time: "2023-01-24T17:01:02.855958522+0000", OS: "Linux-5.4.149-73.259.amzn2.x86_64-x86_64-with-glibc2.31", collector(name:version): "SOCRadar_collector:1.0.0", owner: "integrations_factory@devo.com", started at: "2023-01-25T12:54:13.433352Z"
2023-01-25T12:54:13.440    INFO MainProcess::MainThread -> Initialized all object from "MainProcess" process
2023-01-25T12:54:13.440    INFO MainProcess::MainThread -> OutputProcess - Starting thread (executing_period=120s)
2023-01-25T12:54:13.443    INFO MainProcess::MainThread -> InputProcess - Starting thread (executing_period=120s)
2023-01-25T12:54:13.444    INFO OutputProcess::MainThread -> Process started
2023-01-25T12:54:13.448    INFO MainProcess::MainThread -> Started all object from "MainProcess" process
2023-01-25T12:54:13.448    INFO InputProcess::MainThread -> Process Started
2023-01-25T12:54:13.449    INFO MainProcess::CollectorThread -> global_status: {"main_process": {"process_id": 7, "process_status": "sleeping", "thread_counter": 5, "thread_names": ["MainThread", "QueueFeederThread", "OutputControllerThread", "InputControllerThread", "CollectorThread"], "memory_info": {"rss": "51.41MiB", "vms": "360.62MiB", "shared": "14.38MiB", "text": "8.00KiB", "lib": "0.00B", "data": "76.79MiB", "dirty": "0.00B"}, "CollectorThread": {"running_flag": true, "status": "RUNNING(10)", "shutdown_timestamp": "None", "message_queues": {"standard": {"name": "standard_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 0, "put_lock": "<Lock(owner=None)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f5458370>"}, "lookup": {"name": "lookup_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 0, "put_lock": "<Lock(owner=None)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f5472fd0>"}, "internal": {"name": "internal_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 2, "put_lock": "<Lock(owner=SomeOtherProcess)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f54ca9a0>"}}, "controllers": {"InputControllerThread": {"running_flag": true, "status": "RUNNING(10)", "underlying_process": {"process_id": 12, "process_status": "running", "num_threads": 2, "memory_info": {"rss": "41.45MiB", "vms": "212.62MiB", "shared": "4.45MiB", "text": "8.00KiB", "lib": "0.00B", "data": "56.54MiB", "dirty": "0.00B"}, "exit_code": null}}, "OutputControllerThread": {"running_flag": true, "status": "RUNNING(10)", "underlying_process": {"process_id": 10, "process_status": "running", "num_threads": 1, "memory_info": {"rss": "40.77MiB", "vms": "138.61MiB", "shared": "3.79MiB", "text": "8.00KiB", "lib": "0.00B", "data": "46.41MiB", "dirty": "0.00B"}, "exit_code": null}}}}}}
2023-01-25T12:54:13.451    INFO MainProcess::CollectorThread -> environment_status: {"cpu_count": 8, "cpu_usage": "1:3.09, 5:3.26, 15:3.67, ", "virtual_memory": {"total": "62.03GiB", "available": "56.24GiB", "percent": 9.3, "used": "5.50GiB", "free": "43.61GiB", "active": "4.72GiB", "inactive": "11.08GiB", "buffers": "2.64MiB", "cached": "12.92GiB", "shared": "9.35MiB", "slab": "2.19GiB"}, "disk_usage": {"/dev/termination-log": 5.3, "/etc/hosts": 5.3, "/etc/resolv.conf": 5.3, "/etc/hostname": 5.3, "/etc/devo/collector": 5.3}, "processes_info": [{"pid": 1, "ppid": 0, "process_name": "sh", "process_cmd": "/bin/sh -c devo-collector --config ${CONFIG_FILE:-config.yaml} --prod-mode", "memory_usage": {"rss": "596.00KiB", "vms": "2.55MiB", "shared": "528.00KiB", "text": "96.00KiB", "lib": "0.00B", "data": "316.00KiB", "dirty": "0.00B"}}, {"pid": 7, "ppid": 1, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "51.57MiB", "vms": "360.62MiB", "shared": "14.49MiB", "text": "8.00KiB", "lib": "0.00B", "data": "76.79MiB", "dirty": "0.00B"}}, {"pid": 10, "ppid": 7, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "40.77MiB", "vms": "138.61MiB", "shared": "3.79MiB", "text": "8.00KiB", "lib": "0.00B", "data": "46.41MiB", "dirty": "0.00B"}}, {"pid": 12, "ppid": 7, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "41.46MiB", "vms": "212.62MiB", "shared": "4.45MiB", "text": "8.00KiB", "lib": "0.00B", "data": "56.54MiB", "dirty": "0.00B"}}]}
2023-01-25T12:54:13.493 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.498 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.502 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.503    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(standard_senders,relay_0) -> Starting thread (every 300 seconds)
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSenderManager(standard_senders,manager,relay_0) -> Starting thread
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSender(lookup_senders,devo_sender_0) -> Starting thread
```

### 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-25T12:54:13.396    INFO MainProcess::MainThread -> Added "/devo-collector" directory to the Python path
2023-01-25T12:54:13.396    INFO MainProcess::MainThread -> Added "/devo-collector/config_internal" directory to the Python path
2023-01-25T12:54:13.396    INFO MainProcess::MainThread -> Added "/devo-collector/schemas" directory to the Python path
2023-01-25T12:54:13.396    INFO MainProcess::MainThread -> Production mode: True, execute only setup and exit: False, Python version: "3.9.10 (main, Jan 24 2023, 13:13:38) [GCC 9.4.0]", current dir: "/devo-collector", exists "config" dir: True, exists "config_internal" dir: True, exists "certs" dir: True, exists "schemas" dir: True, exists "credentials" dir: True
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Loading configuration using the following files: {"full_config": "config.yaml", "job_config_loc": null, "collector_config_loc": null}
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> List of files in directory "/devo-collector/config": []
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Using the default location for "job_config_loc" file: "/etc/devo/job/job_config.json"
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Using the default location for "collector_config_loc" file: "/etc/devo/collector/collector_config.json"
2023-01-25T12:54:13.419    INFO MainProcess::MainThread -> Results of validation of config files parameters: {"config": "/devo-collector/config/config.yaml", "config_validated": False, "job_config_loc": "/etc/devo/job/job_config.json", "job_config_loc_default": True, "job_config_loc_validated": True, "collector_config_loc": "/etc/devo/collector/collector_config.json", "collector_config_loc_default": True, "collector_config_loc_validated": True}
2023-01-25T12:54:13.436    INFO MainProcess::MainThread -> Build time: "2023-01-24T17:01:02.855958522+0000", OS: "Linux-5.4.149-73.259.amzn2.x86_64-x86_64-with-glibc2.31", collector(name:version): "SOCRadar_collector:1.0.0", owner: "integrations_factory@devo.com", started at: "2023-01-25T12:54:13.433352Z"
2023-01-25T12:54:13.440    INFO MainProcess::MainThread -> Initialized all object from "MainProcess" process
2023-01-25T12:54:13.440    INFO MainProcess::MainThread -> OutputProcess - Starting thread (executing_period=120s)
2023-01-25T12:54:13.443    INFO MainProcess::MainThread -> InputProcess - Starting thread (executing_period=120s)
2023-01-25T12:54:13.444    INFO OutputProcess::MainThread -> Process started
2023-01-25T12:54:13.448    INFO MainProcess::MainThread -> Started all object from "MainProcess" process
2023-01-25T12:54:13.448    INFO InputProcess::MainThread -> Process Started
2023-01-25T12:54:13.449    INFO MainProcess::CollectorThread -> global_status: {"main_process": {"process_id": 7, "process_status": "sleeping", "thread_counter": 5, "thread_names": ["MainThread", "QueueFeederThread", "OutputControllerThread", "InputControllerThread", "CollectorThread"], "memory_info": {"rss": "51.41MiB", "vms": "360.62MiB", "shared": "14.38MiB", "text": "8.00KiB", "lib": "0.00B", "data": "76.79MiB", "dirty": "0.00B"}, "CollectorThread": {"running_flag": true, "status": "RUNNING(10)", "shutdown_timestamp": "None", "message_queues": {"standard": {"name": "standard_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 0, "put_lock": "<Lock(owner=None)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f5458370>"}, "lookup": {"name": "lookup_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 0, "put_lock": "<Lock(owner=None)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f5472fd0>"}, "internal": {"name": "internal_queue_multiprocessing", "max_size_in_messages": 10000, "max_size_in_mb": 1024, "max_wrap_size_in_items": 100, "current_size": 2, "put_lock": "<Lock(owner=SomeOtherProcess)>", "input_lock": "<multiprocessing.synchronize.Event object at 0x7f69f54ca9a0>"}}, "controllers": {"InputControllerThread": {"running_flag": true, "status": "RUNNING(10)", "underlying_process": {"process_id": 12, "process_status": "running", "num_threads": 2, "memory_info": {"rss": "41.45MiB", "vms": "212.62MiB", "shared": "4.45MiB", "text": "8.00KiB", "lib": "0.00B", "data": "56.54MiB", "dirty": "0.00B"}, "exit_code": null}}, "OutputControllerThread": {"running_flag": true, "status": "RUNNING(10)", "underlying_process": {"process_id": 10, "process_status": "running", "num_threads": 1, "memory_info": {"rss": "40.77MiB", "vms": "138.61MiB", "shared": "3.79MiB", "text": "8.00KiB", "lib": "0.00B", "data": "46.41MiB", "dirty": "0.00B"}, "exit_code": null}}}}}}
2023-01-25T12:54:13.451    INFO MainProcess::CollectorThread -> environment_status: {"cpu_count": 8, "cpu_usage": "1:3.09, 5:3.26, 15:3.67, ", "virtual_memory": {"total": "62.03GiB", "available": "56.24GiB", "percent": 9.3, "used": "5.50GiB", "free": "43.61GiB", "active": "4.72GiB", "inactive": "11.08GiB", "buffers": "2.64MiB", "cached": "12.92GiB", "shared": "9.35MiB", "slab": "2.19GiB"}, "disk_usage": {"/dev/termination-log": 5.3, "/etc/hosts": 5.3, "/etc/resolv.conf": 5.3, "/etc/hostname": 5.3, "/etc/devo/collector": 5.3}, "processes_info": [{"pid": 1, "ppid": 0, "process_name": "sh", "process_cmd": "/bin/sh -c devo-collector --config ${CONFIG_FILE:-config.yaml} --prod-mode", "memory_usage": {"rss": "596.00KiB", "vms": "2.55MiB", "shared": "528.00KiB", "text": "96.00KiB", "lib": "0.00B", "data": "316.00KiB", "dirty": "0.00B"}}, {"pid": 7, "ppid": 1, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "51.57MiB", "vms": "360.62MiB", "shared": "14.49MiB", "text": "8.00KiB", "lib": "0.00B", "data": "76.79MiB", "dirty": "0.00B"}}, {"pid": 10, "ppid": 7, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "40.77MiB", "vms": "138.61MiB", "shared": "3.79MiB", "text": "8.00KiB", "lib": "0.00B", "data": "46.41MiB", "dirty": "0.00B"}}, {"pid": 12, "ppid": 7, "process_name": "devo-collector", "process_cmd": "/usr/local/bin/python /usr/local/bin/devo-collector --config config.yaml --prod-mode", "memory_usage": {"rss": "41.46MiB", "vms": "212.62MiB", "shared": "4.45MiB", "text": "8.00KiB", "lib": "0.00B", "data": "56.54MiB", "dirty": "0.00B"}}]}
2023-01-25T12:54:13.493 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.498 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.502 WARNING OutputProcess::MainThread -> DevoSender::_validate_kwargs_for_method__init__ -> The <address> is not a standard address (collector-eu.devo.io, collector-us.devo.io): collector-ap.devo.io
2023-01-25T12:54:13.503    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(standard_senders,relay_0) -> Starting thread (every 300 seconds)
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSenderManager(standard_senders,manager,relay_0) -> Starting thread
2023-01-25T12:54:13.504    INFO OutputProcess::MainThread -> DevoSender(lookup_senders,devo_sender_0) -> Starting thread
2023-01-25T12:54:13.505    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(lookup_senders,relay_0) -> Starting thread (every 300 seconds)
2023-01-25T12:54:13.505    INFO OutputProcess::MainThread -> DevoSenderManager(lookup_senders,manager,relay_0) -> Starting thread
2023-01-25T12:54:13.505    INFO OutputProcess::MainThread -> DevoSender(internal_senders,devo_sender_0) -> Starting thread
2023-01-25T12:54:13.506    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(internal_senders,relay_0) -> Starting thread (every 300 seconds)
2023-01-25T12:54:13.506    INFO OutputProcess::MainThread -> DevoSenderManager(internal_senders,manager,relay_0) -> Starting thread
2023-01-25T12:54:13.526    INFO InputProcess::MainThread -> InputThread(socradar,17812) - Starting thread (execution_period=60s)
2023-01-25T12:54:13.526    INFO InputProcess::MainThread -> ServiceThread(socradar,17812,incidents,predefined) - Starting thread (execution_period=60s)
2023-01-25T12:54:13.526    INFO InputProcess::MainThread -> SOCRadarPullerSetup(SOCRadar_collector,socradar#17812,incidents#predefined) -> Starting thread
2023-01-25T12:54:13.527    INFO InputProcess::MainThread -> SOCRadarPuller(socradar,17812,incidents,predefined) - Starting thread
```

> ℹ️ By default, these information traces will be displayed every 10 minutes.

#### 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. |
| `Standard - Total number of messages sent: 57, messages sent since "2023-01-10 16:09:16.116750+00:00": 0 (elapsed 0.000 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 `2023-01-10 16:09:16.116750+00:00`.
- 21 events where sent to Devo between the last UTC checkpoint and now.
- Those 21 events required `0.00 seconds` to be delivered.<br>> ℹ️ By default these traces will be shown every 10 minutes. |
</details>