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

## Overview

The Prisma Cloud API allows you to **programmatically** access and manage your Prisma Cloud resources, making it easy to automate tasks, integrate with other tools, and build custom integrations. With a variety of endpoints available, Prisma Cloud API aims to automate tasks and facilitate integrations with a wide range of application types while covering the majority of workflows and use cases currently supported by the Prisma Cloud web interface.

## Devo collector features

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

## Data sources

| **Data source** | **Description** | **API endpoint** | **Collector service name** | **Devo table** | **Available from release** |
| --- | --- | --- | --- | --- | --- |
| Alert | Get the list of alerts. | `/v2/alert` | `alert` | `cloud.paloalto.prisma.alert` | `v1.0.0` |
| Audit | Get the audit logs. | `/audit/redlock` | `audit` | `cloud.paloalto.prisma.audit` | `v1.0.0` |
| Inventory View | Get the latest inventory view data | `/v3/inventory` | `inventory_view` | `cloud.paloalto.prisma.inventory_view` | `v1.0.0` |
| Inventory Trend | Get the data related to historical inventory trends | `/v3/inventory/trend` | `inventory_trend` | `cloud.paloalto.prisma.inventory_trend` | `v1.0.0` |

For more information on how the events are parsed, [visit our page](https://docs.devo.com/space/latest/94661194/cloud.gcp) 

## Flattening preprocessing

| **Data source** | **Collector service** | **Optional** | **Flattening details** |
| --- | --- | --- | --- |
| Alert | alert | yes | not required |
| Audit | audit | yes | not required |
| Inventory View | inventory_view | yes | not required |
| Inventory Trend | inventory_trend | yes | not required |

## Accepted authentication methods

| **Authentication method** | **access_key_id** | **secret_key** |
| --- | --- | --- |
| JWT auth token | REQUIRED | 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** |
| --- | --- |
| access_key_id | The access key id to generate the JWT token for authentication. |
| secret_key | The secret key to generate the JWT token for authentication. |

The auth token timeout specified in Prisma Cloud API official documentation is 600 seconds, but we are using it as **540 seconds** to avoid authentication failure due to any possible lag.

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

## 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": {
>     "prisma_cloud": {
>       "id": "<short_unique_id>",
>       "enabled": "<input_status>",
>       "base_url": "<base_url>",
>       "autoconfig": {
>         "refresh_interval_in_seconds": "<refresh_interval_in_seconds>",
>         "creation_timeout_in_second": "<creation_timeout_in_seconds>"
>       },
>       "credentials": {
>         "access_key_id": "<access_key_id>",
>         "secret_key": "<secret_key>"
>       },
>       "services": {
>         "alert": {
>           "initial_start_time_in_utc": "<initial_start_time_in_utc>",
>           "request_period_in_seconds" : "<request_period_in_seconds>",
>           "limit": "<limit>",
>           "override_tag": "<override_devo_tag>"
>         },
>         "audit": {
>           "initial_start_time_in_utc": "<initial_start_time_in_utc>",
>           "request_period_in_seconds" : "<request_period_in_seconds>",
>           "limit": "<limit>",
>           "override_tag": "<override_devo_tag>"
>         },
>         "inventory_view": {
>           "request_period_in_seconds" : "<request_period_in_seconds>",
>           "override_tag": "<override_devo_tag>"
>         },
>         "inventory_trend": {
>           "request_period_in_seconds" : "<request_period_in_seconds>",
>           "override_tag": "<override_devo_tag>"
>         }
>       }
>     }
>   }
> }
> ```
> 
> > ℹ️ All defined service entities will be executed by the collector. If you do not want to run any of them, just remove the entity from the `services` object.
> 
> Please replace the placeholders with real world values following the description table below:
> 
> | **Parameter** | **Data type** | **Type** | **Value range / Format** | **Details** |
> | --- | --- | --- | --- | --- |
> | `<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. |
> | `<base_url>` | `str` | `Mandatory` | Api base url | Use this param to Provide base URL for API calls. |
> | `<refresh_interval_in_seconds>` | `int` | `Mandatory` | `Maximum value 300` | Use this param to set refresh interval for authentication, collector will check if auth is valid every time after mentioned seconds. Recommended value is 60. |
> | `<creation_timeout_in_seconds>` | `int` | `Mandatory` | `Maximum value 120` | Use this param to set puller creation timeout. Collector will throw error if Puller is not created in mentioned seconds. Recommended value is 60. |
> | `<access_key_id>` | `str` | `Madatory` | Minimum Length 1 | The Access Key ID is your unique identifier used as the Authorization:{key}. |
> | `<secret_key>` | `str` | `Mandatory` | Minimum Length 1 | The Secret Key is your unique token used to authenticate the Access Key ID. |
> | `<initial_start_time_in_utc>` | `str` | `Mandatory` | Minimum Length 1 | The Initial start time is the time from when the logs will be fetched, it needs to be in UTC format and is mandatory for alert/audit service, optional for inventory services. |
> | `<request_period_in_seconds>` | `int` | `Optional` | `Minimum value 60` | Period in seconds used between each data pulling, default value for alert/audit services is 300 seconds and 3600 seconds for inventory services. |
> | `<limit>` | `int` | `Optional` | Maximum value 10000 | This value sets the maximum number of events per page. If not provided the default value from API endpoint will be used which is 10000. |
> | `<override_devo_tag>` | `str` | `Optional` | Table tag | This value is used to override the tag of services. Ex: my.app.devo.alert |
> 
> > Macro (rw-tab)
> 
> This data collector can be run in any machine that has the Docker service available because it should be executed as a docker container. The following sections explain how to prepare all the required setup for having the data collector running.
> 
> ### Structure
> 
> The following directory structure should be created for being used when running the collector:
> 
> ```
> <any_directory>
> └── devo-collectors/
>     └── <product_name>/
>         ├── certs/
>         │   ├── chain.crt
>         │   ├── <your_domain>.key
>         │   └── <your_domain>.crt
>         ├── state/
>         └── config/ 
>             └── config.yaml 
> ```
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Devo credentials
> 
> In Devo, go to **Administration → Credentials → X.509 Certificates**, download the **Certificate**, **Private key** and **Chain CA** and save them in `<product_name>/certs/`. Learn more about security credentials in Devo [here](#).
> 
> ![image](media://e9d2bd10-1f0c-4050-a95d-7332210a0ca1)
> 
> > ⚠️ Replace `<product_name>` with the proper value.
> 
> ### Editing the config.yaml file
> 
> ```
> globals:
>   debug: false
>   id: not_used
>   name: prisma_cloud_collector
>   persistence:
>     type: filesystem
>     config:
>       directory_name: state
> 
> outputs:
>   devo_1:
>     type: devo_platform
>     config:
>       address: <devo_address>
>       port: 443
>       type: SSL
>       chain: <chain_filename>.cert
>       cert: <cert_filename>.crt
>       key: <key_filename>.key
> 
> inputs:
>   prisma_cloud:
>     id: <short_unique_id>
>     enabled: <input_status>
>     base_url: <base_url>
>     autoconfig:
>       refresh_interval_in_second: <refresh_interval_in_seconds>
>       creation_timeout_in_second: <creation_timeout_in_seconds>
>     credentials:
>       access_key_id: <access_key_id>
>       secret_key: <secret_key>
>     services:
>       alert:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         refresh_time_in_seconds: <refresh_time_in_seconds>
>         limit: <limit>
>         override_tag: <override_devo_tag>
>       audit:
>         initial_start_time_in_utc: <initial_start_time_in_utc_value>
>         refresh_time_in_seconds: <refresh_time_in_seconds>
>         limit: <limit>
>         override_tag: <override_devo_tag>
>       inventory_view:
>         refresh_time_in_seconds: <refresh_time_in_seconds>
>         override_tag: <override_devo_tag>
>       inventory_trend:
>         refresh_time_in_seconds: <refresh_time_in_seconds>
>         override_tag: <override_devo_tag>
> ```
> 
> > ℹ️ 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** |
> | --- | --- | --- | --- | --- |
> | `<devo_address>` | `str` | `Mandatory` | [collector-us.devo.io](http://collector-us.devo.io), [collector-eu.devo.io](http://collector-eu.devo.io) | Use this param to identify the Devo Cloud where the events will be sent |
> | `<chain_filename>` | `str` | `Mandatory` | Minimum length: 4, Maximum length: 20 | Use this param to identify the chain.cert file downloaded from your Devo domain. Usually this file's name is: chain.crt |
> | `<cert_filename>` | `str` | `Mandatory` | Minimum length: 4, Maximum length: 20 | Use this param to identify the file.cert downloaded from your Devo domain. |
> | `<key_filename>` | `str` | `Mandatory` | Minimum length: 4, Maximum length: 20 | Use this param to identify the file.key downloaded from your Devo domain. |
> | `<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. |
> | `<base_url>` | `str` | `Mandatory` | Api base url | Use this param to Provide base URL for API calls. |
> | `<refresh_interval_in_seconds>` | `int` | `Mandatory` | `Maximum value 300` | Use this param to set refresh interval for authentication, collector will check if auth is valid every time after mentioned seconds. Recommended value is 60. |
> | `<creation_timeout_in_seconds>` | `int` | `Mandatory` | `Maximum value 120` | Use this param to set puller creation timeout. Collector will throw error if Puller is not created in mentioned seconds. Recommended value is 60. |
> | `<access_key_id>` | `str` | `Madatory` | Minimum Length 1 | The Access Key ID is your unique identifier used as the Authorization:{key}. |
> | `<secret_key>` | `str` | `Mandatory` | Minimum Length 1 | The Secret Key is your unique token used to authenticate the Access Key ID. |
> | `<initial_start_time_in_utc>` | `str` | `Mandatory` | Minimum Length 1 | The Initial start time is the time from when the logs will be fetched, it needs to be in UTC format and is mandatory for alert/audit service, optional for inventory services. |
> | `<request_period_in_seconds>` | `int` | `Optional` | `Minimum value 60` | Period in seconds used between each data pulling, default value for alert/audit services is 300 seconds and 3600 seconds for inventory services. |
> | `<limit>` | `int` | `Optional` | Maximum value 10000 | This value sets the maximum number of events per page. If not provided the default value from API endpoint will be used which is 10000. |
> | `<override_devo_tag>` | `str` | `Optional` | Table tag | This value is used to override the tag of services. Ex: my.app.devo.alert |
> 
> ### 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-prisma_cloud_if-docker-image-2.0.0](https://drive.google.com/file/d/1OKZAodlyfPTN6YN3wPZn18yTlfg7Jbuf/view?usp=drive_link) | a400de24fd991296b1b56189411ad4ce6ecef83f10eacdb6d96174e90a6df5bb |
> 
> Use the following command to add the Docker image to the system:
> 
> ```
> gunzip -c <image_file>-<version>.tgz | docker load
> ```
> 
> > ⚠️ Once the Docker image is imported, it will show the real name of the Docker image (including version info). Replace `<image_file>` and `<version>` with a proper value.
> 
> The Docker image can be deployed on the following services:
> 
> #### Docker
> 
> Execute the following command on the root directory `<any_directory>/devo-collectors/<product_name>/`
> 
> ```
> docker run 
> --name collector-<product_name> 
> --volume $PWD/certs:/devo-collector/certs 
> --volume $PWD/config:/devo-collector/config 
> --volume $PWD/state:/devo-collector/state 
> --env CONFIG_FILE=config.yaml 
> --rm 
> --interactive 
> --tty 
> <image_name>:<version>
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.
> 
> #### Docker Compose
> 
> The following Docker Compose file can be used to execute the Docker container. It must be created in the `<any_directory>/devo-collectors/<product_name>/` directory.
> 
> ```
> version: '3'
> services:
>   collector-<product_name>:
>     image: <image_name>:${IMAGE_VERSION:-latest}
>     container_name: collector-<product_name>
>     volumes:
>       - ./certs:/devo-collector/certs
>       - ./config:/devo-collector/config
>       - ./credentials:/devo-collector/credentials
>       - ./state:/devo-collector/state
>     environment:
>       - CONFIG_FILE=${CONFIG_FILE:-config.yaml}
> ```
> 
> To run the container using docker-compose, execute the following command from the `<any_directory>/devo-collectors/<product_name>/` directory:
> 
> ```
> IMAGE_VERSION=<version> docker-compose up -d
> ```
> 
> > ⚠️ Replace `<product_name>`, `<image_name>` and `<version>` with the proper values.

## Collector services detail

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

### Events service

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

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:

```
2025-01-23T10:47:53.524    INFO OutputProcess::MainThread -> DevoSender(lookup_senders,devo_sender_0) -> Starting thread
2025-01-23T10:47:53.524    INFO OutputProcess::MainThread -> DevoSenderManagerMonitor(lookup_senders,devo_2) -> Starting thread (every 300 seconds)
2025-01-23T10:47:53.524    INFO OutputProcess::MainThread -> DevoSenderManager(lookup_senders,manager,devo_2) -> Starting thread
2025-01-23T10:47:53.525    INFO OutputProcess::DevoSenderManager(lookup_senders,manager,devo_2) -> [EMERGENCY_PERSISTENCE_SYSTEM] Recovering any available content from the persistence system
2025-01-23T10:47:53.525    INFO InputProcess::MainThread -> Validating common input config
2025-01-23T10:47:53.526    INFO OutputProcess::OutputLookupConsumer(lookup_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Recovering any available content from the persistence system
2025-01-23T10:47:53.526    INFO OutputProcess::OutputStandardConsumer(standard_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2025-01-23T10:47:53.526    INFO OutputProcess::OutputStandardConsumer(standard_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.00
2025-01-23T10:47:53.527    INFO OutputProcess::OutputLookupConsumer(lookup_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2025-01-23T10:47:53.527    INFO OutputProcess::OutputLookupConsumer(lookup_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.00
2025-01-23T10:47:53.527    INFO OutputProcess::MainThread -> DevoSender(internal_senders,devo_sender_0) -> Starting thread
2025-01-23T10:47:53.527    INFO OutputProcess::DevoSenderManager(internal_senders,manager,devo_2) -> [EMERGENCY_PERSISTENCE_SYSTEM] Recovering any available content from the persistence system
2025-01-23T10:47:53.528    INFO InputProcess::MainThread -> Validating service input config
2025-01-23T10:47:53.528    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Recovering any available content from the persistence system
2025-01-23T10:47:53.528    INFO OutputProcess::MainThread -> OutputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2025-01-23T10:47:53.529    INFO InputProcess::MainThread -> Running overriding rules
2025-01-23T10:47:53.529    INFO OutputProcess::DevoSenderManager(internal_senders,manager,devo_2) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2025-01-23T10:47:53.529    INFO OutputProcess::DevoSenderManager(internal_senders,manager,devo_2) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.00
2025-01-23T10:47:53.529    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2025-01-23T10:47:53.529    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2025-01-23T10:47:53.529    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2025-01-23T10:47:53.529    INFO OutputProcess::OutputInternalConsumer(internal_senders_consumer_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Elapsed seconds: 0.00
2025-01-23T10:47:53.529    INFO InputProcess::MainThread -> Adding raw config to the collector store
2025-01-23T10:47:53.530    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_counter" created: "Number of messages sent to the defined output", unit: "1"
2025-01-23T10:47:53.530    INFO InputProcess::MainThread -> Running custom validation rules
2025-01-23T10:47:53.530    INFO InputProcess::MainThread -> PrismaCloudPuller(prisma_cloud#23451,audit#predefined) Finalizing the execution of init_variables()
2025-01-23T10:47:53.532    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] Created persistence instance, filename_path: /home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/not_used/prisma_cloud;23451;inventory_view;predefined;PrismaCloudInventoryPuller.json
2025-01-23T10:47:53.533    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] There is no data persisted with the latest format, any previous persisted data will be migrated
2025-01-23T10:47:53.533    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists to migrate (Version 2), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/ae8b4e96b60a096f3f54d9d4be5d6f13"
2025-01-23T10:47:53.533    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists to migrate (Version 1), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/b0c8166a1a3a1693da67377fa9a0d99b"
2025-01-23T10:47:53.534    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] Checking if old persisted data must be removed
2025-01-23T10:47:53.534    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists (Version 2), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/ae8b4e96b60a096f3f54d9d4be5d6f13"
2025-01-23T10:47:53.534    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists (Version 1), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/b0c8166a1a3a1693da67377fa9a0d99b"
2025-01-23T10:47:53.535    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) Starting the execution of init_variables()
2025-01-23T10:47:53.535    INFO InputProcess::MainThread -> Validating service metadata
2025-01-23T10:47:53.536    INFO InputProcess::MainThread -> Validating defined module definition
2025-01-23T10:47:53.540    INFO InputProcess::MainThread -> Validating common input config
2025-01-23T10:47:53.541    INFO InputProcess::MainThread -> Validating service input config
2025-01-23T10:47:53.542    INFO InputProcess::MainThread -> Running overriding rules
2025-01-23T10:47:53.542    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2025-01-23T10:47:53.543    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2025-01-23T10:47:53.543    INFO InputProcess::MainThread -> Adding raw config to the collector store
2025-01-23T10:47:53.543    INFO InputProcess::MainThread -> Running custom validation rules
2025-01-23T10:47:53.543    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) Finalizing the execution of init_variables()
2025-01-23T10:47:53.544    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] Created persistence instance, filename_path: /home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/not_used/prisma_cloud;23451;inventory_trend;predefined;PrismaCloudInventoryPuller.json
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] There is no data persisted with the latest format, any previous persisted data will be migrated
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists to migrate (Version 2), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/898ba6ca8f3097b447bc601f7b6b0df7"
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists to migrate (Version 1), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/656d472346fc85529936965f9bfa5e8c"
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] Checking if old persisted data must be removed
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists (Version 2), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/898ba6ca8f3097b447bc601f7b6b0df7"
2025-01-23T10:47:53.545    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> [PERSISTENCE_SYSTEM] No previous persistence file exists (Version 1), filename_path: "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/state/656d472346fc85529936965f9bfa5e8c"
2025-01-23T10:47:53.546    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) Starting the execution of init_variables()
2025-01-23T10:47:53.546    INFO InputProcess::MainThread -> Validating service metadata
2025-01-23T10:47:53.547    INFO InputProcess::MainThread -> Validating defined module definition
2025-01-23T10:47:53.548    INFO InputProcess::MainThread -> Validating common input config
2025-01-23T10:47:53.550    INFO InputProcess::MainThread -> Validating service input config
2025-01-23T10:47:53.550    INFO InputProcess::MainThread -> Running overriding rules
2025-01-23T10:47:53.550    INFO InputProcess::MainThread -> Validating the rate limiter config given by the user
2025-01-23T10:47:53.550    INFO InputProcess::MainThread -> <requests_limits> setting has not been defined. The generic settings will be used instead.
2025-01-23T10:47:53.551    INFO InputProcess::MainThread -> Adding raw config to the collector store
2025-01-23T10:47:53.551    INFO InputProcess::MainThread -> Running custom validation rules
2025-01-23T10:47:53.551    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) Finalizing the execution of init_variables()
2025-01-23T10:47:53.551    INFO InputProcess::MainThread -> InputThread(prisma_cloud,23451) - Starting thread (execution_period=60s)
2025-01-23T10:47:53.552    INFO InputProcess::MainThread -> ServiceThread(prisma_cloud,23451,alert,predefined) - Starting thread (execution_period=60s)
2025-01-23T10:47:53.552    INFO InputProcess::MainThread -> PrismaCloudPullerSetup(prisma_cloud#23451,alert#predefined) -> Starting thread
2025-01-23T10:47:53.552    INFO InputProcess::MainThread -> PrismaCloudPuller(prisma_cloud#23451,alert#predefined) - Starting thread
2025-01-23T10:47:53.552 WARNING InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,alert#predefined) -> The token/header/authentication has not been created yet
2025-01-23T10:47:53.553 WARNING InputProcess::PrismaCloudPuller(prisma_cloud#23451,alert#predefined) -> Waiting until setup will be executed
2025-01-23T10:47:53.553    INFO InputProcess::MainThread -> ServiceThread(prisma_cloud,23451,audit,predefined) - Starting thread (execution_period=60s)
2025-01-23T10:47:53.553    INFO InputProcess::MainThread -> PrismaCloudPullerSetup(prisma_cloud#23451,audit#predefined) -> Starting thread
2025-01-23T10:47:53.554    INFO InputProcess::MainThread -> PrismaCloudPuller(prisma_cloud#23451,audit#predefined) - Starting thread
2025-01-23T10:47:53.554 WARNING InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,audit#predefined) -> The token/header/authentication has not been created yet
2025-01-23T10:47:53.554 WARNING InputProcess::PrismaCloudPuller(prisma_cloud#23451,audit#predefined) -> Waiting until setup will be executed
2025-01-23T10:47:53.556    INFO InputProcess::MainThread -> ServiceThread(prisma_cloud,23451,inventory_view,predefined) - Starting thread (execution_period=60s)
2025-01-23T10:47:53.557    INFO InputProcess::MainThread -> PrismaCloudPullerSetup(prisma_cloud#23451,inventory_view#predefined) -> Starting thread
2025-01-23T10:47:53.557    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) - Starting thread
2025-01-23T10:47:53.557 WARNING InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,inventory_view#predefined) -> The token/header/authentication has not been created yet
2025-01-23T10:47:53.557 WARNING InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Waiting until setup will be executed
2025-01-23T10:47:53.558    INFO InputProcess::MainThread -> ServiceThread(prisma_cloud,23451,inventory_trend,predefined) - Starting thread (execution_period=60s)
2025-01-23T10:47:53.559    INFO InputProcess::MainThread -> PrismaCloudPullerSetup(prisma_cloud#23451,inventory_trend#predefined) -> Starting thread
2025-01-23T10:47:53.560    INFO InputProcess::MainThread -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) - Starting thread
2025-01-23T10:47:53.560 WARNING InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,inventory_trend#predefined) -> The token/header/authentication has not been created yet
2025-01-23T10:47:53.560 WARNING InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_trend#predefined) -> Waiting until setup will be executed
2025-01-23T10:47:53.561    INFO OutputProcess::MainThread -> [GC] global: 37.3% -> 37.4%, process: RSS(62.25MiB -> 62.87MiB), VMS(1.08GiB -> 1.08GiB)
2025-01-23T10:47:53.561    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_sent_bytes" created: "Number of bytes sent to the defined output", unit: "1"
2025-01-23T10:47:53.561    INFO InputProcess::MainThread -> InputMetricsThread -> Started thread for updating metrics values (update_period=10.0)
2025-01-23T10:47:53.564    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "vendor_requests" created: "Number of requests received from the vendor API", unit: "requests"
2025-01-23T10:47:53.592    INFO InputProcess::MainThread -> [GC] global: 37.4% -> 37.4%, process: RSS(62.75MiB -> 63.25MiB), VMS(1.15GiB -> 1.15GiB)
2025-01-23T10:47:53.593    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_received" created: "Number of messages received from the vendor API", unit: "1"
2025-01-23T10:47:53.593    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_removed" created: "Number of messages removed by the collector", unit: "1"
2025-01-23T10:47:53.594    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_incoming_filtered" created: "Number of messages filtered by the collector", unit: "1"
2025-01-23T10:47:53.594    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_counter" created: "Number of messages enqueued", unit: "1"
2025-01-23T10:47:53.595    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_standard_bytes" created: "Number of bytes enqueued", unit: "1"
2025-01-23T10:47:53.595    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_counter" created: "Number of messages enqueued", unit: "1"
2025-01-23T10:47:53.596    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_lookup_bytes" created: "Number of messages enqueued", unit: "1"
2025-01-23T10:47:53.596    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_counter" created: "Number of messages enqueued in the queue", unit: "1"
2025-01-23T10:47:53.596    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Counter "msg_enqueued_internal_bytes" created: "Number of messages enqueued in the queue", unit: "1"
2025-01-23T10:47:53.597    INFO MainProcess::MetricsConsumerThread -> OpenTelemetryServer -> [METRIC] Gauge "module_global_status" created: "Global status of current module", unit: "1"
2025-01-23T10:47:54.245    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/shivank/PycharmProjects/Devo/devo-prismacloud-collector/certs/chain.crt", "cert_path": "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/certs/int-if-integrations-india.crt", "key_path": "/home/shivank/PycharmProjects/Devo/devo-prismacloud-collector/certs/int-if-integrations-india.key", "transport_layer_type": "SSL", "last_usage_timestamp": null, "socket_status": null}, hostname: "shivank", session_id: "137403887435248"
2025-01-23T10:47:54.245    INFO OutputProcess::DevoSender(internal_senders,devo_sender_0) -> [EMERGENCY_PERSISTENCE_SYSTEM] Nothing available in the persistence system
2025-01-23T10:47:55.513    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,audit#predefined) -> Token is valid. Skipping the generation of new auth token 
2025-01-23T10:47:55.515    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,audit#predefined) -> Token is valid. Skipping the generation of new auth token 
2025-01-23T10:47:55.516    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,audit#predefined) -> Setup for module <PrismaCloudPuller> has been successfully executed
2025-01-23T10:47:55.560    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,audit#predefined) -> PrismaCloudPuller(prisma_cloud#23451,audit#predefined) Starting the execution of pre_pull()
2025-01-23T10:47:55.561    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,audit#predefined) -> Reading persisted data
```

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

```
2025-01-23T10:47:56.579    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,alert#predefined) -> Pull Started
2025-01-23T10:47:56.581    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,alert#predefined) -> Fetching data From : 2025-01-22T11:30:00.000000Z
2025-01-23T10:47:59.446    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,inventory_view#predefined) -> Token is valid. Skipping the generation of new auth token 
2025-01-23T10:47:59.456    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,inventory_view#predefined) -> Token is valid. Skipping the generation of new auth token 
2025-01-23T10:47:59.467    INFO InputProcess::PrismaCloudPullerSetup(prisma_cloud#23451,inventory_view#predefined) -> Setup for module <PrismaCloudInventoryPuller> has been successfully executed
2025-01-23T10:47:59.571    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) Starting the execution of pre_pull()
2025-01-23T10:47:59.592    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Reading persisted data
2025-01-23T10:47:59.632    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Data retrieved from the persistence: None
2025-01-23T10:47:59.633 WARNING InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Persistence will be overridden due to the retrieved state is empty
2025-01-23T10:47:59.633    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Running the persistence upgrade steps
2025-01-23T10:47:59.635    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Running the persistence corrections steps
2025-01-23T10:47:59.635    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Running the persistence corrections steps
2025-01-23T10:47:59.635 WARNING InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Some changes have been detected and the persistence needs to be updated. Previous content: None. New content: {'@persistence_version': 1, 'start_time': None, 'last_ids': []}
2025-01-23T10:47:59.638    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Updating the persistence
2025-01-23T10:47:59.640 WARNING InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Persistence has been updated successfully
2025-01-23T10:47:59.640    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) Finalizing the execution of pre_pull()
2025-01-23T10:47:59.640    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Starting data collection every 60 seconds
2025-01-23T10:47:59.642    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Pull Started
2025-01-23T10:47:59.644    INFO InputProcess::PrismaCloudInventoryPuller(prisma_cloud#23451,inventory_view#predefined) -> Fetching data
2025-01-23T10:47:59.838    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,audit#predefined) -> Sent 28966 audit events to Devo.
```

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

```
2025-01-23T10:47:59.839    INFO InputProcess::PrismaCloudPuller(prisma_cloud#23451,audit#predefined) -> (Partial) Statistics for this pull cycle (@devo_pulling_id=1737609475560):Number of requests made: 1; Number of events received: 28966; Number of duplicated events filtered out: 0; Number of events generated and sent: 28966; Average of events per second: 6812.879.
```

> ℹ️ The value `@devo_pulling_id` is injected in each event to group all events ingested by the same pull action. You can use it to get the exact events downloaded in that `Pull` action in Devo’s search window.
</details>

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

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

1. Edit the configuration file.
2. Change the value of the `reset_persistence_auth` 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. |
| 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 |
| InitVariablesErrorSetupError | 100 | `HTTP Error occurred while generating auth token from prisma server	` | Wrong credentials | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| 101 | `Some error occurred while generating auth token from prisma server. Error details: {e}` | Generate auth token api failed | Contact the developer with exact error message. |
| 102 | `HTTP Error occurred while refreshing auth token. Summary: {e}` | Extend auth token api failed | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| 103 | `Failed to refresh auth token. Reason {e}` | Prisma API call is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| 104 | `HTTP Error occurred while trying to reach endpoint` | Service endpoint is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| 105 | `Failed to reach out to endpoint. Reason {e}` | Service endpoint is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| PullError | 300 | `HTTP Error occurred while fetching apim incident from prisma cloud server` | Prisma API call is failing | Check the credentials and ensure that the collector has the necessary permissions to access the Prisma API. |
| 301 | `Some error occurred while fetching apim incident from prisma cloud server. Error details: {e}` | Prisma API call is failing | Contact the developer with exact error message. |
</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`

```
2025-01-23T10:47:53.561    INFO OutputProcess::MainThread -> [GC] global: 37.3% -> 37.4%, process: RSS(62.25MiB -> 62.87MiB), VMS(1.08GiB -> 1.08GiB)
2025-01-23T10:47:53.592    INFO InputProcess::MainThread -> [GC] global: 37.4% -> 37.4%, process: RSS(62.75MiB -> 63.25MiB), VMS(1.15GiB -> 1.15GiB)
```

> ℹ️ 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>

<details>
<summary>Enable/disable the logging debug mode</summary>

Sometimes it is necessary to activate the debug mode of the collector's logging. This debug mode increases the verbosity of the log and allows you to print execution traces that are very helpful in resolving incidents or detecting bottlenecks in heavy download processes.

- To enable this option you just need to edit the configuration file and change the debug_status parameter from false to true and restart the collector.
- To disable this option, you just need to update the configuration file and change the debug_status parameter from true to false and restart the collector.

For more information, visit the configuration and parameterization section corresponding to the chosen deployment mode.
</details>

## Change log

| **Release** | **Released on** | **Release type** | **Details** | **Recommendations** |
| --- | --- | --- | --- | --- |
| `v2.0.0` | 1/15/2025 | [IMPROVEMENT][Security] | Refactor codebase and upgraded to DCSDK 1.13.1 | `Recommended version` |
| `v1.0.5` | 11/6/2023 | [IMPROVEMENT] | Added new `debug` property for logging messages. By default `false` | `Update` |
| `v1.0.4` | 11/3/2023 | [IMPROVEMENT] | Added new `lag_time` property and logging messages | `Update` |
| `v1.0.3` | 4/26/2023 | [Changed] | Changed request method for alerts endpoint from `GET` to `POST` | `Update` |
| `v1.0.1` | 7/9/2020 | [Improvements] | Added delta_time for inventory_view and inventory_view log types | `Update` |
| `v1.0.0` | 7/7/2020 | [Feature] | Initial version | `Update` |