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

## Overview

Lark is an all-in-one productivity solution that includes chat, scheduling, docs, video conferencing, auto-translation and more in a single platform.

## Devo collector features

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

## Data sources

| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| --- | --- | --- | --- | --- | --- |
| `audit_infos` | Returns all the audit logs. | `admin/v1/audit_infos` | `audit_infos` | `app.lark.audit.event` | `v1.0.0` |
| `admin_log` | Returns all the aud admin logs. | `aud_admin_logs` | `admin_log` | `app.lark.admin.log` | `v1.3.0` |
| `dlp_execute_log` | Returns all the DLP Execute logs. | `dlp_execute_logs` | `dlp_execute_log` | `app.lark.dlp.log` | `v1.3.0` |

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

## Flattening preprocessing

| **Data source** | **Collector service** | **Optional** | **Flattening details** |
| --- | --- | --- | --- |
| `audit_infos` | `audit_infos` | `yes` | not required |
| `admin_log` | `aud_admin_logs` | `yes` | not required |
| `dlp_execute_log` | `dlp_execute_logs` | `yes` | not required |

## Minimum configuration required for basic pulling

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

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

| **Setting** | **Details** |
| --- | --- |
| `app_id` | The app ID to generate the auth token for authentication. |
| `app_secret` | The app secret key to.generate the auth token for authentication. |

## API limits, delays, known Issues

The API only allows 2 valid auth tokens at a time, so you should avoid using the credentials used for the collector should not  be used somewhere else while its running.

###### Duplicate DLP Executive Logs in API Response :

The API occasionally returns duplicate entries for the same log when queried. This behaviour occurs on the API side and is currently unresolved.

## Accepted authentication methods

| **Authentication method** | **app_id** | **app_secret** |
| --- | --- | --- |
| Bearer auth token | [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": {
>     "lark": {
>      "id": "<short_unique_id>",
>       "enabled": true,
>       "credentials": {
>         "app_id": "<app_id_value>",
>         "app_secret": "<app_secret_value>"
>       },
>       "services": {
>         "audit_infos": {
>           "initial_start_time_in_utc": "<start_time_in_utc_value>",
>           "override_tag": "<override_tag_value>",
>           "override_base_url": "<override_base_url_value>",
>           "event_name": "<event_name_value>",
>           "operator_value": "operator_value",
>           "event_module": "<event_module_value>",
>           "operator_type": "<operator_type_value>"
>         },
>         "admin_log": {
>           "initial_start_time_in_utc": "<start_time_in_utc_value>",
>           "override_tag": "<override_tag_value>",
>           "override_base_url": "<override_base_url_value>",
>           "event_name": "<event_name_value>",
>           "category_name": "<category_name_value>",
>           "user_id_type": "<user_id_type_value>",
>           "user_id": "<user_id_value>"
>         },
>         "dlp_execute_log": {
>           "initial_start_time_in_utc": "<start_time_in_utc_value>",
>           "override_tag": "<override_tag_value>",
>           "override_base_url": "<override_base_url_value>",
>           "user_id_type": "<user_id_type_value>",
>           "user_id": "<user_id_value>",
>           "hit_policy_names": "<hit_policy_names_value>",
>           "apply_module": "<apply_module_value>",
>           "actions": "<actions_value>",
>           "locale": "<locale_value>"
>         }
>       }
>     }
>   }
> }
> ```
> 
> 
> The following table outlines the parameters available for configuring the collector. Each parameter is categorized by its necessity (mandatory or optional), data type, acceptable values or formats, and a brief description.
> 
> | **Parameter** | **Data type** | **Type** | **Value range / Format** | **Details** |
> | --- | --- | --- | --- | --- |
> 
> |  |  |  |  |  |
> | --- | --- | --- | --- | --- |
> | <short_unique_id> | `int` | `Mandatory` | Minimum Length 5 | Use this param to give a unique id to this input service.<br>This parameter is used to build the persistence address, do not use the same value for multiple collectors. It could cause a collision. |
> | <input_status> | `bool` | `Mandatory` | false / true | Use this param to enable or disable the given input logic when running the collector. If the value is true, the input will be run. If the value is false, it will be ignored. |
> | <app_id_value> | `str` | `Mandatory` | Minimum Length 1 | App id for Lark developer |
> | <app_secret_value> | `str` | `Mandatory` | Minimum Length 1 | App secret key for Lark developer |
> | <override_devo_value> | `str` | `Optional` | A devo tag | This parameter allows defining a custom devo tag. |
> | <override_base_url_value> | `str` | `Optional` | Minimum Length 1 | This parameter allows defining a custom base url.   
> **Example base url:** [https://open.larksuite.com/open-apis/admin/v1/](https://open.larksuite.com/open-apis/admin/v1/) |
> | <event_name_value> | `str` | `Optional` | Minimum Length 1 | Behavioral event name, such ascreate_doc. For names of optional events, see [List of enumerated values](https://open.larksuite.com/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/appendix) |
> | <operator_value> | `str` | `Optional` | Minimum Length 1 | Operator value |
> | <event_module_value> | `int` | `Optional` | Minimum Length 1 | Behavioral audit event module. For the event modules of behavioral audit, see [List of enumerated values](https://open.larksuite.com/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/appendix) |
> | <operator_type_value> | `str` | `Optional` | Minimum Length 1 | Operator type value |
> | <start_time_in_utc_value> | `str` | `Mandatory` | UTC format/ `Not more than 180 days old` from current date | Start date to pull data from **For DLP execute logs it should not more that 120 days old** |
> | <category_name> | `str` | `Optional` | Minimum Length 1 | Category name value |
> | <user_id> | `str` | `Optional` | Minimum Length 1 | User ID value.   
> When user_id_type is open_id, this value needs to be filled in with the corresponding open_id value;   
> When user_id_type is user_id, the value needs to be filled with the corresponding user_id value;   
> When user_id_type is union_id, this value needs to be filled in with the corresponding union_id value. |
> | <user_id_type> | `str` | `Optional` | Minimum Length 1 | User ID Type value.   
> user_id type: open_id, user_id or union_id.   
> The default value is open_id. |
> | <hit_policy_names> | `str` | `Optional` | Minimum Length 1 | Hit Policy Names value.   
> Hit strategy list   
> **Example** value: [""Strategy A""] |
> | <apply_module> | `int` | `Optional` | Minimum Length 1 | Apply Module value.   
> Application range module   
> **Example value**: 99 application The application range of dlp is 99, which means "all", and currently only this value is supported |
> | <actions> | `int[]` | `Optional` | Minimum Length 1 | Actions value.   
> Execute action list.   
> **Example value**: [0: release 1: interception 2: timeout interception 3: abnormal interception 4: only record release 5: only record timeout interception 6: only record abnormal interception, when the action needs to be filtered, apply_module, app_apply_module need to ensure that there are values at the same time.] |
> | <locale> | str | `Optional` | Minimum Length 1 | locale   
> Example value: "zh-CN"   
> **Optional values are:**   
> `en-US：English`   
> `zh-CN：Chinese`   
> `a-JP：Japanese` |
> 
> **Note**: 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-20240702-093110.png](media://b0bcbff5-4e92-4b50-a845-ddd83736739a)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>  debug: false
>  id: not_used
>  name: lark_collector
>  persistence:
>    type: filesystem
>    config:
>      directory_name: state
> outputs:
>   devo_1:
>     type: devo_platform
>     config:
>       address: <your-ingestion-endpoint>
>       port: 443
>       type: SSL
>       chain: chain.crt
>       cert: <your_domain>.crt
>       key: <your_domain>.key
> inputs:
>  lark:
>     id: <short_unique_id>
>     enabled: <input_status>
>     credentials:
>      app_id: <app_id_value>
>      app_secret: <app_secret_value>
>     services:
>       audit_infos:
>         initial_start_time_in_utc: <start_time_in_utc_value>
>         override_tag: <override_tag_value>
>         override_base_url: <override_base_url_value>
>         event_name : <event_name_value>
>         operator_value: <operator_value>
>         event_module: <event_module_value>
>         operator_type: <operator_type_value>
>       admin_log:
>         initial_start_time_in_utc: <start_time_in_utc_value>
>         override_tag: <override_tag_value>
>         override_base_url: <override_base_url_value>
>         event_name: <event_name_value>
>         category_name: <category_name_value>
>         user_id_type: <user_id_type_value>
>         user_id: <user_id_value>
>       dlp_execute_log:
>         initial_start_time_in_utc: <start_time_in_utc_value>
>         override_tag: <override_tag_value>
>         override_base_url: <override_base_url_value>
>         hit_policy_names: <hit_policy_names_value>
>         user_id: <user_id_value>
>         user_id_type: <user_id_type_value>
>         apply_module: <apply_module_value>
>         actions: <actions_value>
>         locale: <locale_value>
> ```
> 
> > ℹ️ All defined service entities will be executed by the collector. If you do not want to run any of them, just remove the entity from the `services` object.
> 
> Replace the placeholders with your required values following the description table below:
> 
> | **Parameter** | **Data type** | **Type** | **Value range / Format** | **Details** |
> | --- | --- | --- | --- | --- |
> | <short_unique_id> | `int` | `Mandatory` | Minimum Length 5 | Use this param to give a unique id to this input service.<br>This parameter is used to build the persistence address, do not use the same value for multiple collectors. It could cause a collision. |
> | <input_status> | `bool` | `Mandatory` | false / true | Use this param to enable or disable the given input logic when running the collector. If the value is true, the input will be run. If the value is false, it will be ignored. |
> | <app_id_value> | `str` | `Mandatory` | Minimum Length 1 | App id for Lark developer |
> | <app_secret_value> | `str` | `Mandatory` | Minimum Length 1 | App secret key for Lark developer |
> | <override_devo_value> | `str` | `Optional` | A devo tag | This parameter allows defining a custom devo tag. |
> | <override_base_url_value> | `str` | `Optional` | Minimum Length 1 | This parameter allows defining a custom base url.   
> **Example base url:** [https://open.larksuite.com/open-apis/admin/v1/](https://open.larksuite.com/open-apis/admin/v1/) |
> | <event_name_value> | `str` | `Optional` | Minimum Length 1 | Behavioral event name, such ascreate_doc. For names of optional events, see [List of enumerated values](https://open.larksuite.com/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/appendix) |
> | <operator_value> | `str` | `Optional` | Minimum Length 1 | Operator value |
> | <event_module_value> | `int` | `Optional` | Minimum Length 1 | Behavioral audit event module. For the event modules of behavioral audit, see [List of enumerated values](https://open.larksuite.com/document/ukTMukTMukTM/uQjM5YjL0ITO24CNykjN/audit_log/appendix) |
> | <operator_type_value> | `str` | `Optional` | Minimum Length 1 | Operator type value |
> | <start_time_in_utc_value> | `str` | `Mandatory` | UTC format/ `Not more than 180 days old` from current date | Start date to pull data from **For DLP execute logs it should not more than 120 days old** |
> | <category_name> | `str` | `Optional` | Minimum Length 1 | Category name value |
> | <user_id> | `str` | `Optional` | Minimum Length 1 | User ID value.   
> When user_id_type is open_id, this value needs to be filled in with the corresponding open_id value;   
> When user_id_type is user_id, the value needs to be filled with the corresponding user_id value;   
> When user_id_type is union_id, this value needs to be filled in with the corresponding union_id value. |
> | <user_id_type> | `str` | `Optional` | Minimum Length 1 | User ID Type value.   
> user_id type: open_id, user_id or union_id.   
> The default value is open_id. |
> | <hit_policy_names> | `str` | `Optional` | Minimum Length 1 | Hit Policy Names value.   
> Hit strategy list   
> **Example** value: [""Strategy A""] |
> | <apply_module> | `int` | `Optional` | Minimum Length 1 | Apply Module value.   
> Application range module   
> **Example value**: 99 application The application range of dlp is 99, which means "all", and currently only this value is supported |
> | <actions> | `int[]` | `Optional` | Minimum Length 1 | Actions value.   
> Execute action list.   
> **Example value**: [0: release 1: interception 2: timeout interception 3: abnormal interception 4: only record release 5: only record timeout interception 6: only record abnormal interception, when the action needs to be filtered, apply_module, app_apply_module need to ensure that there are values at the same time.] |
> | <locale> | `str` | `Optional` | Minimum Length 1 | locale   
> Example value: "zh-CN"   
> **Optional values are:**   
> `en-US：English`   
> `zh-CN：Chinese`   
> `a-JP：Japanese` |
> 
> ### 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-lark_suite_if-docker-image-1.3.0](https://drive.google.com/file/d/1lP0WDPGuisAQZ7PgqzWq6TKP3R-x8F_e/view?usp=drive_link) | `13c4fa3ed0546534451a4030a04d21c17ec0be4ba67d0d4cb5e4cad87eeda912e408cb005ec4be2cde19b741439fc821c5da7a052ce715e2bec5a6492879afb7` |
> 
> 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.

### Audit info

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

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

This service has the following components:

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

#### Setup output

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

```
2024-06-24T08:09:59.388    INFO OutputProcess::MainThread -> ConsoleSenderManager(lookup_senders,manager,console_1) -> Starting thread
2024-06-24T08:09:59.389    INFO OutputProcess::MainThread -> DevoSender(internal_senders,devo_sender_0) -> Starting thread
2024-06-24T08:09:59.390    INFO OutputProcess::ConsoleSenderManager(lookup_senders,manager,console_1) -> [EMERGENCY PERSISTENCE SYSTEM] ConsoleSenderManager(lookup_senders,manager,console_1) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.390    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(internal_senders,devo_2) -> Starting thread (every 300 seconds)
2024-06-24T08:09:59.391    INFO OutputProcess::OutputLookupConsumer(lookup_senders_consumer_0) -> [EMERGENCY PERSISTENCE SYSTEM] OutputLookupConsumer(lookup_senders_consumer_0) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.391    INFO OutputProcess::MainThread -> DevoSenderManager(internal_senders,manager,devo_2) -> Starting thread
2024-06-24T08:09:59.392    INFO OutputProcess::MainThread -> ConsoleSender(internal_senders,console_sender_0) -> Starting thread
2024-06-24T08:09:59.392    INFO OutputProcess::MainThread -> ConsoleSenderManagerMonitor(internal_senders,console_1) -> Starting thread (every 300 seconds)
2024-06-24T08:09:59.393    INFO OutputProcess::DevoSenderManager(internal_senders,manager,devo_2) -> [EMERGENCY PERSISTENCE SYSTEM] DevoSenderManager(internal_senders,manager,devo_2) -> Nothing retrieved from the persistence.
2024-06-24T08:09:59.393    INFO OutputProcess::MainThread -> ConsoleSenderManager(internal_senders,manager,console_1) -> Starting thread
2024-06-24T08:09:59.395    INFO OutputProcess::ConsoleSenderManager(internal_senders,manager,console_1) -> [EMERGENCY PERSISTENCE SYSTEM] ConsoleSenderManager(internal_senders,manager,console_1) -> Nothing retrieved from the persistence.
2024-06-24T08:10:00.212    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Successfully generated auth token for Lark API
2024-06-24T08:10:00.216    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:40:00.213", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Successfully generated auth token for Lark API\", \"time\": \"2024-06-24T02:40:00.213215Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:10:02.957    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Remote source is pullable
2024-06-24T08:10:02.958    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-06-24T08:10:02.959    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-06-24T08:10:02.959    INFO InputProcess::LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Setup for module <LarkBasePuller> 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.

```
2024-06-24T08:15:25.789    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Pull Started
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.788", "message_tag": "devo.collectors.out.local.warning", "message_content": "{\"msg\": \"Persistence has been updated successfully\", \"time\": \"2024-06-24T02:45:25.788960Z\", \"level\": \"warning\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"LarkBasePuller(lark,964383,audit_infos,predefined) Finalizing the execution of pre_pull()\", \"time\": \"2024-06-24T02:45:25.789209Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.790    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Starting data collection every 15 seconds\", \"time\": \"2024-06-24T02:45:25.789388Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:25.791    INFO OutputProcess::ConsoleSender(internal_senders,console_sender_0) -> {"message_timestamp": "2024-06-24 02:45:25.789", "message_tag": "devo.collectors.out.local.info", "message_content": "{\"msg\": \"Pull Started\", \"time\": \"2024-06-24T02:45:25.789572Z\", \"level\": \"info\", \"collector_name\": \"lark_collector\", \"collector_version\": \"1.0.0\", \"collector_image\": null, \"job_id\": \"not_used\", \"input_name\": \"lark\", \"service_name\": \"audit_infos\", \"module_name\": \"LarkBasePuller\"}"}
2024-06-24T08:15:30.372    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Retrieved 50 audit_infos event(s)
2024-06-24T08:15:30.376    INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Sent 50 events
```

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

```
2024-06-24T08:19:07.641 INFO InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1719197345217):Number of requests made: 1; Number of events received: 1; Number of duplicated events filtered out: 0; Number of events generated and sent: 1; Average of events per second: 0.414.
```
</details>

### **Aud Admin logs**

<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 an organized way and delivering the events via SDK. |

**Setup output**

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

```
2024-11-12T15:31:18.765    INFO InputProcess::MainThread -> LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Starting thread
2024-11-12T15:31:18.766    INFO InputProcess::MainThread -> LarkAdminLogsPuller(lark#87499,admin_log#predefined) - Starting thread
2024-11-12T15:31:18.766 WARNING InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> The token/header/authentication has not been created yet
2024-11-12T15:31:18.766 WARNING InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Waiting until setup will be executed
2024-11-12T15:31:18.766    INFO InputProcess::MainThread -> InputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2024-11-12T15:31:18.769    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-11-12T15:31:18.769    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.02
2024-11-12T15:31:18.769    INFO OutputProcess::MainThread -> OutputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2024-11-12T15:31:18.779 WARNING MainProcess::CollectorThread -> There is a process that now it doesn't exists (pid=160175)
2024-11-12T15:31:18.785    INFO OutputProcess::MainThread -> [GC] global: 65.7% -> 65.7%, process: RSS(63.10MiB -> 63.23MiB), VMS(1.07GiB -> 1.07GiB)
2024-11-12T15:31:18.786    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_counter" created: "Number of messages sent to the defined output", unit: "1"
2024-11-12T15:31:18.787    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_bytes" created: "Number of bytes sent to the defined output", unit: "1"
2024-11-12T15:31:18.789    INFO InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Generating Auth Token for Lark API
2024-11-12T15:31:18.789    INFO InputProcess::MainThread -> [GC] global: 65.7% -> 65.7%, process: RSS(62.62MiB -> 62.99MiB), VMS(522.53MiB -> 522.53MiB)
2024-11-12T15:31:18.791    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "vendor_requests" created: "Number of requests received from the vendor API", unit: "requests"
2024-11-12T15:31:18.791    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_received" created: "Number of messages received from the vendor API", unit: "1"
2024-11-12T15:31:18.791    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_removed" created: "Number of messages removed by the collector", unit: "1"
2024-11-12T15:31:18.791    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_filtered" created: "Number of messages filtered by the collector", unit: "1"
2024-11-12T15:31:18.791    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_counter" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_bytes" created: "Number of bytes enqueued", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_counter" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_bytes" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_counter" created: "Number of messages enqueued in the queue", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_bytes" created: "Number of messages enqueued in the queue", unit: "1"
2024-11-12T15:31:18.792    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Gauge "module_global_status" created: "Global status of current module", unit: "1"
2024-11-12T15:31:19.167    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> Created a sender: {"name": "DevoSender(internal_senders,devo_sender_0)", "url": "collector-eu.devo.io:443", "chain_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/chain.crt", "cert_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.crt", "key_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.key", "transport_layer_type": "SSL", "last_usage_timestamp": null, "socket_status": null}, hostname: "2023-APAC-0049", session_id: "140695202259296"
2024-11-12T15:31:19.167    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-11-12T15:31:19.620    INFO InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Successfully generated auth token for Lark API
2024-11-12T15:31:20.789    INFO InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-11-12T15:31:20.790    INFO InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-11-12T15:31:20.791    INFO InputProcess::LarkAdminLogsPullerSetup(lark#87499,admin_log#predefined) -> Setup for module <LarkAdminLogsPuller> 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.

```
2024-11-12T15:31:20.804    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pull Started
2024-11-12T15:31:20.805    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:22.566    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 1; Number of events received: 100; Number of duplicated events filtered out: 0; Number of events generated and sent: 100; Average of events per second: 56.748.
2024-11-12T15:31:22.569    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:22.901    INFO OutputProcess::DevoSender(standard_senders,devo_sender_0) -> Created a sender: {"name": "DevoSender(standard_senders,devo_sender_0)", "url": "collector-eu.devo.io:443", "chain_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/chain.crt", "cert_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.crt", "key_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.key", "transport_layer_type": "SSL", "last_usage_timestamp": null, "socket_status": null}, hostname: "2023-APAC-0049", session_id: "140695206083888"
2024-11-12T15:31:22.902    INFO OutputProcess::DevoSender(standard_senders,devo_sender_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-11-12T15:31:24.289    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 2; Number of events received: 200; Number of duplicated events filtered out: 0; Number of events generated and sent: 200; Average of events per second: 57.384.
2024-11-12T15:31:24.292    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:25.790    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 3; Number of events received: 300; Number of duplicated events filtered out: 0; Number of events generated and sent: 300; Average of events per second: 60.167.
2024-11-12T15:31:25.792    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:27.256    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 4; Number of events received: 400; Number of duplicated events filtered out: 0; Number of events generated and sent: 400; Average of events per second: 62.000.
2024-11-12T15:31:27.257    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:29.027    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 5; Number of events received: 500; Number of duplicated events filtered out: 0; Number of events generated and sent: 500; Average of events per second: 60.808.
2024-11-12T15:31:29.029    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:30.740    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 6; Number of events received: 600; Number of duplicated events filtered out: 0; Number of events generated and sent: 600; Average of events per second: 60.388.
2024-11-12T15:31:30.742    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Pulling data from 2024-10-20 13:10:00+00:00
2024-11-12T15:31:32.525    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 7; Number of events received: 674; Number of duplicated events filtered out: 0; Number of events generated and sent: 674; Average of events per second: 57.503.
2024-11-12T15:31:32.526    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 7; Number of events received: 674; Number of duplicated events filtered out: 0; Number of events generated and sent: 674; Average of events per second: 57.497.
2024-11-12T15:31:32.527    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> The data is up to date!
```

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

```
2024-11-12T15:31:22.566    INFO InputProcess::LarkAdminLogsPuller(lark#87499,admin_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731405680792):Number of requests made: 1; Number of events received: 100; Number of duplicated events filtered out: 0; Number of events generated and sent: 100; Average of events per second: 56.748.
```
</details>

### **DLP Execute logs**

<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 an organized way and delivering the events via SDK. |

**Setup output**

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

```
2024-11-12T15:44:09.494    INFO InputProcess::MainThread -> LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) - Starting thread
2024-11-12T15:44:09.494 WARNING InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> The token/header/authentication has not been created yet
2024-11-12T15:44:09.495 WARNING InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> Waiting until setup will be executed
2024-11-12T15:44:09.495    INFO InputProcess::MainThread -> InputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2024-11-12T15:44:09.519    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-11-12T15:44:09.493    INFO OutputProcess::MainThread -> OutputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2024-11-12T15:44:09.519    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.03
2024-11-12T15:44:09.519    INFO InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> Generating Auth Token for Lark API
2024-11-12T15:44:09.519    INFO InputProcess::MainThread -> [GC] global: 66.3% -> 66.4%, process: RSS(62.51MiB -> 63.01MiB), VMS(522.54MiB -> 522.54MiB)
2024-11-12T15:44:09.520    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "vendor_requests" created: "Number of requests received from the vendor API", unit: "requests"
2024-11-12T15:44:09.520    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_received" created: "Number of messages received from the vendor API", unit: "1"
2024-11-12T15:44:09.521    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_removed" created: "Number of messages removed by the collector", unit: "1"
2024-11-12T15:44:09.521    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_filtered" created: "Number of messages filtered by the collector", unit: "1"
2024-11-12T15:44:09.521    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_counter" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:44:09.521    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_bytes" created: "Number of bytes enqueued", unit: "1"
2024-11-12T15:44:09.522    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_counter" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:44:09.522    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_bytes" created: "Number of messages enqueued", unit: "1"
2024-11-12T15:44:09.522    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_counter" created: "Number of messages enqueued in the queue", unit: "1"
2024-11-12T15:44:09.522    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_bytes" created: "Number of messages enqueued in the queue", unit: "1"
2024-11-12T15:44:09.522    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Gauge "module_global_status" created: "Global status of current module", unit: "1"
2024-11-12T15:44:09.524 WARNING MainProcess::CollectorThread -> There is a process that now it doesn't exists (pid=160175)
2024-11-12T15:44:09.536    INFO OutputProcess::MainThread -> [GC] global: 66.4% -> 66.4%, process: RSS(63.12MiB -> 63.12MiB), VMS(1.07GiB -> 1.07GiB)
2024-11-12T15:44:09.536    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_counter" created: "Number of messages sent to the defined output", unit: "1"
2024-11-12T15:44:09.537    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_bytes" created: "Number of bytes sent to the defined output", unit: "1"
2024-11-12T15:44:09.916    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> Created a sender: {"name": "DevoSender(internal_senders,devo_sender_0)", "url": "collector-eu.devo.io:443", "chain_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/chain.crt", "cert_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.crt", "key_path": "/home/pulkit/devo/collectors/devo-collector-lark/certs/int-if-integrations-india.key", "transport_layer_type": "SSL", "last_usage_timestamp": null, "socket_status": null}, hostname: "2023-APAC-0049", session_id: "136645911000256"
2024-11-12T15:44:09.916    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2024-11-12T15:44:10.415    INFO InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> Successfully generated auth token for Lark API
2024-11-12T15:44:11.193    INFO InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-11-12T15:44:11.194    INFO InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> Token is valid. Skipping the generation of new auth token 
2024-11-12T15:44:11.194    INFO InputProcess::LarkDLPLogsPullerSetup(lark#87499,dlp_execute_log#predefined) -> Setup for module <LarkDLPLogsPuller> 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.

```
2024-11-12T15:44:11.509    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> Starting data collection every 60 seconds
2024-11-12T15:44:11.510    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> Pull Started
2024-11-12T15:44:11.511    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> Pulling data from 2024-07-01 06:10:00+00:00
2024-11-12T15:44:12.026    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731406451498):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-11-12T15:44:12.027    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> Statistics for this pull cycle (@devo_pulling_id=1731406451498):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-11-12T15:44:12.028    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> The data is up to date!
```

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

```
2024-11-12T15:45:12.245    INFO InputProcess::LarkDLPLogsPuller(lark#87499,dlp_execute_log#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1731406511498):Number of requests made: 1; Number of events received: 50; Number of duplicated events filtered out: 0; Number of events generated and sent: 50; Average of events per second: 67.033.
```
</details>

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

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

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

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

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

<details>
<summary>Troubleshooting</summary>

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

| **Error type** | **Error ID** | **Error message** | **Cause** | **Solution** |
| --- | --- | --- | --- | --- |
| `InitVariablesError` | 1 | `initial_start_time_in_utc` is not set as per the `datetime_format : {datetime_format}` | The date in config is not as per required format | Ensure the date format is correct. |
| `InitVariablesError` | 2 | Date `{initial_start_time_str}` is in the future | The date in config is greater than current time | Ensure the datetime is less than current time |
| `SetupError` | 100 | HTTP error occurred while generating auth token from Lark server | Wrong credentials | Check the credentials and ensure that the collector has the necessary permissions to access the Lark API. |
| `SetupError` | 101 | Some error occurred while generating auth token from Lark server. Error details: `{e}` | Generate auth token api failed | Contact the developer with exact error message. |
| `SetupError` | 102 | Unable to generate auth token with status code as `{response.status_code}` | Generate auth token api failed | Contact the developer with exact error message. |
| `SetupError` | 103 | HTTP Error occurred while fetching audit infos from Lark server | Lark API call is failing | Contact the developer with exact error message. |
| `SetupError` | 104 | Some error occurred while fetching audit infos from Lark server. Error details: `{e}` | Lark API call is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Lark API. |
| `PullError` | 300 | HTTP error occurred while fetching audit infos from Lark server | Lark API call is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Lark API. |
| `PullError` | 301 | Some error occurred while fetching audit infos from Lark server. Error details: `{e}` | Lark API call is failing | Contact the developer with exact error message. |
</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:

```
2024-06-24T08:27:31.886    INFO InputProcess::MainThread -> Process Started
2024-06-24T08:27:31.945    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) Starting the execution of init_variables()
2024-06-24T08:27:31.946    INFO InputProcess::MainThread -> Validating service metadata
2024-06-24T08:27:31.949    INFO InputProcess::MainThread -> Validating defined module definition
2024-06-24T08:27:31.956    INFO InputProcess::MainThread -> Validating common input config
2024-06-24T08:27:31.959    INFO InputProcess::MainThread -> Validating service input config
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Running overriding rules
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Overriding rule #1 - service key <override_tag> with value <my.app.lark.audit_test> overrides definition key <tag> with value <None> when the first is not <None>
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2024-06-24T08:27:31.961    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2024-06-24T08:27:31.962    INFO InputProcess::MainThread -> Adding raw config to the collector store
2024-06-24T08:27:31.962    INFO InputProcess::MainThread -> Running custom validation rules
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> Creating API client.
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> Created request client: <agent.modules.lark.commons.lark_client.LarkClient object at 0x7796c07f8e50>
2024-06-24T08:27:31.965    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) Finalizing the execution of init_variables()
2024-06-24T08:27:31.967    INFO InputProcess::MainThread -> InputThread(lark,964383) - Starting thread (execution_period=60s)
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> ServiceThread(lark,964383,audit_infos,predefined) - Starting thread (execution_period=60s)
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> LarkBasePullerSetup(lark_collector,lark#964383,audit_infos#predefined) -> Starting thread
2024-06-24T08:27:31.968    INFO InputProcess::MainThread -> LarkBasePuller(lark,964383,audit_infos,predefined) - Starting thread
2024-06-24T08:27:31.968    INFO OutputProcess::MainThread -> DevoSender(standard_senders,devo_sender_0) -> Starting thread
2024-06-24T08:27:31.969 WARNING InputProcess::LarkBasePuller(lark,964383,audit_infos,predefined) -> Waiting until setup will be executed
```

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

```
2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Number of available senders: 1, sender manager internal queue size: 0
2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> enqueued_elapsed_times_in_seconds_stats: {}
2024-06-24T08:40:34.130    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Sender: ConsoleSender(standard_senders,console_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
2024-06-24T08:40:34.131    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Standard - Total number of messages: 667 messages/bytes sent since/to "2024-06-24T03:05:34.119248+00:00/2024-06-24T03:10:34.131023+00:00": 667/1942773, (elapsed 0.078 seconds)
2024-06-24T08:40:34.131    INFO OutputProcess::ConsoleSenderManagerMonitor(standard_senders,console_1) -> Output metric sent
2024-06-24T08:40:34.132    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Number of available senders: 1, sender manager internal queue size: 0
2024-06-24T08:40:34.132    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> enqueued_elapsed_times_in_seconds_stats: {}
2024-06-24T08:40:34.133    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Sender: ConsoleSender(internal_senders,console_sender_0), status: {"internal_queue_size": 0, "is_connection_open": True}
2024-06-24T08:40:34.133    INFO OutputProcess::ConsoleSenderManagerMonitor(internal_senders,console_1) -> Internal - Total number of messages: 205 messages/bytes sent since/to "2024-06-24T03:05:34.127673+00:00/2024-06-24T03:10:34.133181+00:00": 205/84900, (elapsed 0.045 seconds)
```

> ℹ️ 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. |
| `Total number of messages sent: 44, messages sent since "2022-06-28 10:39:22.511671+00:00": 21 (elapsed 0.007 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 `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. |
</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`

```
2023-11-10T09:57:53.856    INFO InputProcess::MainThread -> [GC] global: 39.1% -> 39.1%, process: RSS(68.84MiB -> 68.84MiB), VMS(503.30MiB -> 503.30MiB)
2023-11-10T09:58:53.862    INFO OutputProcess::MainThread -> [GC] global: 39.1% -> 39.1%, process: RSS(49.12MiB -> 49.12MiB), VMS(928.57MiB -> 928.57MiB)
```

> ℹ️ Differences between `RSS` and `VMS` memory usage:
> ℹ️ 
> ℹ️ - `RSS` is the Resident Set Size, which is the actual physical memory the process is using
> ℹ️ - `VMS` is the Virtual Memory Size which is the virtual memory that process is using
</details>

## Change log

| **Release** | **Released on** | **Release type** | **Details** | **Recommendations** |
| --- | --- | --- | --- | --- |
| `1.3.0` | `12 Nov 2024` | [Feature] | **Improvements**<br>- Updated the DCSDK from 1.12.4 to v1.13.1:
  - Change internal queue management for protecting against OOMK
  - Extracted ModuleThread structure from PullerAbstract
  - Improve Controlled stop when both processes fails to instantiate
  - Improve Controlled stop when InputProcess is killed
  - Fixed error related a ValueError exception not well controlled
  - Fixed error related with loss of some values in internal messages<br>**Feature**<br>- Added two new services
  - 1. DLP Execute logs
  - 2. Aud Admin logs | Recomended |
| `1.2.0` | `03 Oct 2024` | [IMPROVEMENTS] | **Improvements**<br>- Updated the DCSDK from 1.12.2 to v1.12.4:
  - Fixed error related a ValueError exception not well controlled.
  - Fixed error related with loss of some values in internal messages (collector_name, collector_id and job_id)
  - Improve Controlled stop when InputProcess is killed
  - Change internal queue management for protecting against OOMK
  - Extracted ModuleThread structure from PullerAbstract
  - Improve Controlled stop when both processes fails to instatiate<br>**Bug fixes**<br>- Solved problem with a loop that caused stops in the collector
- Updated pull and persistence logic to avoid event loss | Recomended |
| `v1.1.0` | 7/22/2024 | [IMPROVEMENTS] | #### Improvements<br>- Updated the DCSDK from 1.11.1 to v1.12.2
- Added new sender for relay in house + TLS
- Added persistence functionality for gzip sending buffer
- Added Automatic activation of gzip sending
- Improved behaviour when persistence fails
- Upgraded DevoSDK dependency
- Fixed console log encoding
- Restructured python classes
- Improved behavior with non-utf8 characters
- Decreased defaut size value for internal queues (Redis limitation, from 1GiB to 256MiB)
- New persistence format/structure (compression in some cases)
- Removed dmesg execution (It was invalid for docker execution)
- DevoSDK has been updated to version 5.4.0<br>#### Bug fixing<br>- Fixed the access token invalid bug. | `Update` |
| `v1.0.0` | 7/1/2024 | [INITIAL VERSION] | `-` | `-` |