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

## Overview

Citrix Cloud is a platform that provides cloud services to facilitate the delivery of Citrix technologies. It centralizes control and simplifies the deployment and management of Citrix technologies like Virtual Apps and Desktops, Networking, and more. Citrix Cloud aims to enhance efficiency by managing workloads on any cloud—public, private, or hybrid—thus offering flexibility and scalability to meet various business needs.

## Devo collector features

| **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** |
| --- | --- | --- | --- | --- |
| Site Configuration Operations Logs | Site configuration operations involve setting up and maintaining the infrastructure for websites or cloud services. This includes configuring server settings, managing domains, establishing network parameters, and implementing security protocols to ensure optimal performance, scalability, and security. | `ConfigLog/Operations/$search` | `site_config_log_operations` | `daas.citrix.config.event` |
| System Logs | Citrix Cloud system logs provide detailed records of system activities, helping monitor and troubleshoot the operations of Citrix Cloud services. These logs are essential for auditing, diagnosing issues, and ensuring the secure and efficient functioning of cloud-based resources. | `systemlog/records` | `system_log_operations` | `daas.citrix.system.event` |

Check more information about these data tables in [this article](https://devodocs.atlassian.net/wiki/spaces/latest/pages/688226307).

## Vendor setup

### Set up a BigQuery project for reporting logs - Google Workspace Admin Help

Supported editions for this feature include Frontline Standard, Enterprise Standard and Plus, Education Standard and Plus, and Enterprise Essentials Plus. [Compare your edition](https://support.google.com/a/answer/6043385).

Before you set up BigQuery logs in the Google Admin console, establish a BigQuery project for your reporting logs in the Google Cloud console:

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> In the [Google Cloud console](https://console.cloud.google.com/), create or open an active BigQuery project. For detailed instructions, visit [Creating and managing projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects). 
> 
> > ⚠️ Billing must be enabled for each project you create.
> 
> > Macro (rw-step)
> 
> Go to the [IAM & Admin page](https://console.cloud.google.com/iam-admin/iam/) for your project.
> 
> > Macro (rw-step)
> 
> To add a project editor:
> 
> 1. At the top of the page, click **Add**.
> 2. In **New members**, enter the project editor's user ID.
> 3. In **Select a role**, choose **Project** then **Editor**.
> 4. Optionally, to assign the project owner role, click **Add Another Role** and select **Project**, then **Owner**.
> 5. Click **Save**.

### Create an API client

To use APIs, an API client must be created in Citrix Cloud:

> Macro (rw-ui-steps-macro)
> 
> > Macro (rw-step)
> 
> Navigate to the Citrix Cloud console and access the menu at the top left of the screen.
> 
> ![image-20240618-121431.png](media://7f2604ba-1029-4839-a540-c9e10dbfc932)
> 
> > Macro (rw-step)
> 
> Choose **Identity and Access Management **from the menu. If you cannot see this option, you might need additional permissions, which can be obtained from your administrator. 
> 
> ![image-20240618-121504.png](media://81292b8e-d20d-41ec-86ea-248e9cb7431a)
> 
> > Macro (rw-step)
> 
> Go to the **API Access** tab.
> 
> ![image-20240618-121532.png](media://89485fd6-3809-4ccb-9b1c-6ae8510544c0)
> 
> > Macro (rw-step)
> 
> Enter a name for your Secure Client and select **Create Client**.
> 
> ![image-20240618-121624.png](media://f67005c5-7cb9-4505-89e4-a38b22bf9962)
> 
> > Macro (rw-step)
> 
> Upon successful creation, a message will display, confirming the generation of an ID and Secret. Ensure you download or copy both. These credentials are required to access the APIs.
> 
> ![image-20240618-121646.png](media://b43c4633-99eb-4d0a-86aa-24fdb18f6355)
> 
> > Macro (rw-step)
> 
> Note down the customer ID shown above the **Create Client** button, as it's also needed for API access.
> 
> ![image-20240618-121722.png](media://323b82c9-f8fa-4560-8584-0a38bfdadd03)

### Getting the Citrix Cloud region

By default, the collector is configured to use the US region. If you are using a different region, you need to specify it in the collector configuration file. The available regions are:

- `"us"`
- `"eu"`
- `"aps"`
- `"jp"`

## 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** |
| --- | --- |
| `customer_id` | The Citrix Cloud customer ID. |
| `client_id` | The Citrix Cloud client ID. |
| `client_secret` | The Citrix Cloud client secret. |

## Accepted authentication methods

| **Authentication method** | **Customer ID** | **Client ID** | **Client secret** |
| --- | --- | --- | --- |
| OAuth2 | [Required] | [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": {
>     "citrix_cloud": {
>       "id": "<short_unique_id>",
>       "enabled": true,
>       "credentials": {
>         "customer_id": "<customer_id_value>",
>         "client_id": "<client_id_value>",
>         "client_secret": "<client_secret_value>"
>       },
>       "environment": "<environment_value>",
>       "override_region": "<override_region_value>",
>       "services": {
>         "site_config_log_operations": {
>           "request_period_in_seconds": "<request_period_in_seconds_value>",
>           "start_time_in_utc": "<start_time_in_utc_value>",
>           "include_low_level": "<include_low_level_value>",
>           "override_tag": "<override_tag_value>"
>         },
>         "system_logs": {
>           "request_period_in_seconds": "<request_period_in_seconds_value>",
>           "start_time_in_utc": "<start_time_in_utc_value>",
>           "override_tag": "<override_tag_value>"
>         }
>       }
>     }
>   }
> }
> ```
> 
> Please replace the placeholders with real world values following the description table below:
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data type** | **Requirement** | **Value range / Format** | **Description** |
> | `short_unique_id` | `str` | Mandatory | Min length: 1, Max length: 5 | Short, unique ID for input service, used in persistence addressing. Avoid duplicates to prevent collisions. |
> | `customer_id_value` | `str` | Mandatory | Min length: 1 | Tenant ID. |
> | `client_id_value` | `str` | Mandatory | Min length: 1 | Client ID. |
> | `client_secret_value` | `str` | Mandatory | Min length: 1 | Client secret. |
> | `environment_value` | `str` | Optional | Min length: 1 | Differentiates environments (e.g., dev, prod). Remove if unused. |
> | `override_region` | `str` | Optional | One of: "us", "eu", "aps", "jp" | Your Citrix Cloud region. Default value: "us" |
> | `request_period_in_seconds_value` | `int` | Optional | Min: 60 | Custom period in seconds between data pulls, overriding default (300s). |
> | `start_time_in_utc_value` | `str` | Optional | UTC datetime format: `%Y-%m-%dT%H-%M-%SZ` | Custom start date for data retrieval, for historical data download. Remove if unused. |
> | `include_low_level` | `bool` | Optional | Default: `false` | Each site configuration operation log can optionally include multiple "low-level operations". When enabled as `true`, the respective low-level operations are stored in an array within the corresponding site configuration log entry. |
> | `override_tag` | `str` | Optional | Min length: 1 | An optional tag to override the default tag for the Devo table. |
> 
> > ℹ️ Parameters marked as "Mandatory" are required for the collector's configuration. Optional parameters can be omitted or removed if not used, but they provide additional customization and control over the collector's behavior.
> 
> > 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-20240618-122355.png](media://48d2abaa-97e0-4b24-b961-eaf71542061f)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: false
>   id: <collector_id_value>
>   name: <collector_name_value>
>   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:
>   citrix_cloud:
>     id: <short_unique_id>
>     enabled: true
>     credentials:
>       customer_id: <customer_id_value>
>       client_id: <client_id_value>
>       client_secret: <client_secret_value>
>     environment: <environment_value>
>     override_region: <override_region_value>
>     services:
>       site_config_log_operations:
>         request_period_in_seconds: <request_period_in_seconds_value>
>         start_time_in_utc: <start_time_in_utc_value>
>         include_low_level: <include_low_level_value>
>       system_logs:
>         request_period_in_seconds: <request_period_in_seconds_value>
>         start_time_in_utc: <start_time_in_utc_value>
> ```
> 
> Replace the placeholders with your required values following the description table below:
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | **Parameter** | **Data type** | **Requirement** | **Value range / Format** | **Description** |
> | `short_unique_id` | `str` | Mandatory | Min length: 1, Max length: 5 | Short, unique ID for input service, used in persistence addressing. Avoid duplicates to prevent collisions. |
> | `customer_id_value` | `str` | Mandatory | Min length: 1 | Tenant ID. |
> | `client_id_value` | `str` | Mandatory | Min length: 1 | Client ID. |
> | `client_secret_value` | `str` | Mandatory | Min length: 1 | Client secret. |
> | `environment_value` | `str` | Optional | Min length: 1 | Differentiates environments (e.g., dev, prod). Remove if unused. |
> | `override_region` | `str` | Optional | One of: "us", "eu", "aps", "jp" | Your Citrix Cloud region. Default value: "us" |
> | `request_period_in_seconds_value` | `int` | Optional | Min: 60 | Custom period in seconds between data pulls, overriding default (300s). |
> | `start_time_in_utc_value` | `str` | Optional | UTC datetime format: `%Y-%m-%dT%H-%M-%SZ` | Custom start date for data retrieval, for historical data download. Remove if unused. |
> | `include_low_level` | `bool` | Optional | Default: `false` | Each site configuration operation log can optionally include multiple "low-level operations". When enabled as `true`, the respective low-level operations are stored in an array within the corresponding site configuration log entry. |
> | `override_tag` | `str` | Optional | Min length: 1 | An optional tag to override the default tag for the Devo table. |
> 
> > ℹ️ Parameters marked as "Mandatory" are required for the collector's configuration. Optional parameters can be omitted or removed if not used, but they provide additional customization and control over the collector's behavior.
> 
> ### 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-citrix_cloud-docker-image-1.2.0](https://drive.google.com/file/d/1BfHDH_JJdeRz8nFmTr9pbF9KFwqIZ9Xj/view?usp=drive_link) | `426e10add4c88502558986786c53499a9484cf07e33840e021ea5a1f198ef083` |
> 
> 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.

<details>
<summary>Site Configuration Operations Logs (site_config_log_operations)</summary>

#### Internal process and deduplication method

All site configuration operation logs are fetched continually based on the `EndTime` datetime key. The collector stores the last `EndTime` value and respective log IDs to ensure that no duplicate records are ingested into the Devo table.

#### Devo categorization and destination

All events of this service are ingested into the table `daas.citrix.config.event`

#### Setup output

```
2024-05-08T20:42:14.627    INFO InputProcess::MainThread -> ConfigLogOperationsPullerSetup(unknown,citrix_cloud#100000,site_config_log_operations#predefined) -> Starting thread
2024-05-08T20:42:14.627    INFO InputProcess::MainThread -> ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) - Starting thread
2024-05-08T20:42:14.640    INFO InputProcess::MainThread -> [GC] global: 50.3% -> 50.3%, process: RSS(58.92MiB -> 59.97MiB), VMS(390.28GiB -> 390.29GiB)
```

#### Puller output

```
2024-05-08T20:42:16.640    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Reading persisted data
2024-05-08T20:42:16.644    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Data retrieved from the persistence: {'@persistence_version': 1, 'start_time_in_utc': '2023-01-10T00:00:00.000000Z', 'last_event_time_in_utc': '2023-01-10T00:00:00.000000Z', 'last_ids': [], 'sites': {'2c7509c3-cb4e-4fd2-b2fc-e71cf324d70b': {'last_event_time_in_utc': '2024-04-16T14:48:09.000000Z', 'last_ids': ['792c7f8c7d7fd46ef53dab3af10b9bf3fe5d79f4dae9722c14ca11305f5eb224']}}, 'next_sites': [], 'next_kwargs': {}}
2024-05-08T20:42:16.645    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Running the persistence upgrade steps
2024-05-08T20:42:16.645    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Running the persistence corrections steps
2024-05-08T20:42:16.646    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Running the persistence corrections steps
2024-05-08T20:42:16.647    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> No changes were detected in the persistence
2024-05-08T20:42:16.647    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) Finalizing the execution of pre_pull()
2024-05-08T20:42:16.647    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Starting data collection every 300 seconds
2024-05-08T20:42:16.648    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Pull Started
2024-05-08T20:42:17.464    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Received 174 records for site cloudxdsite (2c7509c3-cb4e-4fd2-b2fc-e71cf324d70b).
2024-05-08T20:42:17.467    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Sending 174 record(s) to tag 'my.app.citrix_cloud.config_log_operations'
2024-05-08T20:42:17.472    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Sent 174 records for site cloudxdsite (2c7509c3-cb4e-4fd2-b2fc-e71cf324d70b).
2024-05-08T20:42:17.472    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> No more records available. Setting pull_completed to True.
2024-05-08T20:42:17.476    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Updating the persistence
2024-05-08T20:42:17.476    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1715215336638):Number of requests made: 2; Number of events received: 174; Number of duplicated events filtered out: 0; Number of events generated and sent: 174; Average of events per second: 210.142.
2024-05-08T20:42:17.476    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1715215336638):Number of requests made: 2; Number of events received: 174; Number of duplicated events filtered out: 0; Number of events generated and sent: 174; Average of events per second: 210.077.
2024-05-08T20:42:17.477    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> The data is up to date!
2024-05-08T20:42:17.477    INFO InputProcess::ConfigLogOperationsPuller(citrix_cloud,100000,site_config_log_operations,predefined) -> Data collection completed. Elapsed time: 0.839 seconds. Waiting for 299.161 second(s) until the next one
```

#### Restart the persistence

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_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.
</details>

<details>
<summary>System Logs (system_logs)</summary>

#### Internal process and deduplication method

All site configuration operation logs are fetched continually based on the `utcTimestamp` datetime key. The collector stores the last `utcTimestamp` value and respective log IDs to ensure that no duplicate records are ingested into the Devo table.

#### Devo categorization and destination

All events of this service are ingested into the table `daas.citrix.system.event`

#### Setup output

```
2024-05-08T20:50:30.010    INFO InputProcess::MainThread -> SystemLogsPullerSetup(unknown,citrix_cloud#100000,system_logs#predefined) -> Starting thread
2024-05-08T20:50:30.011    INFO InputProcess::MainThread -> SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) - Starting thread
2024-05-08T20:50:30.023    INFO InputProcess::MainThread -> [GC] global: 50.4% -> 50.4%, process: RSS(59.53MiB -> 60.33MiB), VMS(390.79GiB -> 390.79GiB)
2024-05-08T20:50:30.661    INFO InputProcess::SystemLogsPullerSetup(unknown,citrix_cloud#100000,system_logs#predefined) -> Setup for module <SystemLogsPuller> has been successfully executed
```

#### Puller output

As the puller operates, periodically partial statistics will be sent to the logs.

```
2024-05-08T20:50:31.014    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Reading persisted data
2024-05-08T20:50:31.014    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Data retrieved from the persistence: {'@persistence_version': 1, 'start_time_in_utc': '2023-09-10T00:00:00.000000Z', 'last_event_time_in_utc': '2024-05-09T00:00:00.000000Z', 'last_ids': ['dcef065aea4f8ca624e6a50cd922872c5bb50545c79bcb6a2e5e9f8266ecc79f']}
2024-05-08T20:50:31.015    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Running the persistence upgrade steps
2024-05-08T20:50:31.015    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Running the persistence corrections steps
2024-05-08T20:50:31.015    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Running the persistence corrections steps
2024-05-08T20:50:31.016    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> No changes were detected in the persistence
2024-05-08T20:50:31.016    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) Finalizing the execution of pre_pull()
2024-05-08T20:50:31.016    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Starting data collection every 300 seconds
2024-05-08T20:50:31.016    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Pull Started
2024-05-08T20:50:31.017    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Fetching system records from 2024-05-09T00:00:00+00:00 to 2024-05-09T00:50:26.014193+00:00.
2024-05-08T20:50:31.097    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Pull completed up to the current time.
2024-05-08T20:50:31.100    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Updating the persistence
2024-05-08T20:50:31.101    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1715215831014):Number of requests made: 1; Number of events received: 0; Number of duplicated events filtered out: 0; Number of events generated and sent: 0; Average of events per second: 0.000.
2024-05-08T20:50:31.101    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Statistics for this pull cycle (@devo_pulling_id=1715215831014):Number of requests made: 1; Number of events received: 0; Number of duplicated events filtered out: 0; Number of events generated and sent: 0; Average of events per second: 0.000.
2024-05-08T20:50:31.101    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> The data is up to date!
2024-05-08T20:50:31.101    INFO InputProcess::SystemLogsPuller(citrix_cloud,100000,system_logs,predefined) -> Data collection completed. Elapsed time: 0.087 seconds. Waiting for 299.913 second(s) until the next one
```

#### Restart the persistence

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_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.
</details>

## Troubleshooting 

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.

### Common logic

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| **Error type** | **Error ID** | **Error message** | **Cause** | **Solution** |
| `InitVariablesError` | 1 | Invalid `start_time_in_utc: {ini_start_str}`. Must be in parseable datetime format. | The configured `start_time_in_utc` parameter is a non-parseable format. | Update the `start_time_in_utc` value to have the recommended format as indicated in the guide. |
| `InitVariablesError` | 2 | Invalid `start_time_in_utc: {ini_start_str}`. Must be in the past. | The configured `start_time_in_utc` parameter is a future date. | Update the `start_time_in_utc` value to a past datetime. |
| `ApiError` | 401 | An error occurred while trying to authenticate with the Azure API. Exception: `{e}` | The collector is unable to authenticate with the Azure API. | Check the credentials and ensure that the collector has the necessary permissions to access the Azure API. |
| `ApiError` | 410 | An error occurred while trying to check if container `{container_name}` exists. Ensure that the blob storage account name or connection string is correct. Exception: `{e}` | The collector was unable to locate the specified blob storage container name. | Ensure the container exists and the credentials have READ access to the container |
| `ApiError` | 411 | An error occurred while trying to check if container `{container_name}` exists. Ensure that the application has necessary permissions to access the containers. Exception: `{e}` | The collector was unable to access the specified blob storage container name. | Ensure the container exists and the credentials have READ access to the container |
| `ApiError` | 412 | An error occurred while trying to create container `{container_name}`. Ensure that the application has necessary permissions to create containers. Exception: `{e}` | The collector was unable to create the container for the auto discover service and the user indicated to use Azure Blob Storage checkpointing. | Ensure the credentials have WRITE access to the container storage account. |
| `ApiError` | 420 | An error occurred while trying to get consumer group `{consumer_group_name}`. Exception: `{e}` | The collector was unable to access the specified consumer group name. | Ensure the consumer group exists and the credentials have READ access to the consumer group |
| `ApiError` | 421 | An error occurred while trying to create consumer group `{consumer_group_name}`. Ensure that the application has necessary permissions to create consumer groups. Exception: `{e}` | The collector was unable to create the consumer group for the auto discover service. | Ensure the credentials have WRITE access to the event hub namespace or use the `$Default` consumer group. |

## 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-test-local.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": "C:\git\collectors2\devo-collector-<name>\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: 57, messages sent since "2023-01-10 16:09:16.116750+00:00": o (elapsed 0.000 seconds)` | Displays 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. |
</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** | **Recommendations** |
| --- | --- | --- | --- |
| `v1.2.0` | 10/9/2024 | [Improvement] | `Recommended version` |
|  |
| `v1.0.1` | 6/18/2024 | [Improvement]   
[bug fixing] | `-` |
|  |
| `v1.0.0` | 5/15/2024 | [new feature] | `-` |
|  |