Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 2eb0f40

Browse files
committed
[client & backend] DEBUG LOGS
1 parent 48b2cb4 commit 2eb0f40

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,7 @@ def apply_patch(self, item):
24752475
self.apply_patch_files(item)
24762476

24772477
def apply_opencti_operation(self, item, operation):
2478+
self.opencti.app_logger.info("-- apply_opencti_opeartion --")
24782479
if operation == "delete":
24792480
delete_id = item["id"]
24802481
self.opencti.stix.delete(id=delete_id)
@@ -2485,6 +2486,7 @@ def apply_opencti_operation(self, item, operation):
24852486
elif operation == "patch":
24862487
self.apply_patch(item=item)
24872488
elif operation == "add_pir_dependency":
2489+
self.opencti.app_logger.info("add_pir_dependency operation !!")
24882490
id = item["id"]
24892491
input = item["input"]
24902492
self.opencti.pir.add_pir_dependency(id=id, input=input)
@@ -2504,6 +2506,7 @@ def import_item(
25042506
work_id: str = None,
25052507
):
25062508
worker_logger = self.opencti.logger_class("worker")
2509+
self.opencti.app_logger.info("------import item----------")
25072510
# Ultimate protection to avoid infinite retry
25082511
if processing_count > MAX_PROCESSING_COUNT:
25092512
if work_id is not None:
@@ -2744,6 +2747,7 @@ def import_bundle(
27442747
types: List = None,
27452748
work_id: str = None,
27462749
) -> List:
2750+
self.opencti.app_logger.info("---import bundle------")
27472751
# Check if the bundle is correctly formatted
27482752
if "type" not in stix_bundle or stix_bundle["type"] != "bundle":
27492753
raise ValueError("JSON data type is not a STIX2 bundle")
@@ -2759,10 +2763,13 @@ def import_bundle(
27592763
_, bundles = stix2_splitter.split_bundle_with_expectations(
27602764
stix_bundle, False, event_version
27612765
)
2762-
# Import every element in a specific order
2766+
self.opencti.app_logger.info("---import bundle after splitter------", { "bundles": json.dumps(bundles) })
2767+
# Import every element in a specific order
27632768
imported_elements = []
27642769
for bundle in bundles:
2770+
self.opencti.app_logger.info("---bundle------")
27652771
for item in bundle["objects"]:
2772+
self.opencti.app_logger.info("---item------", { "item": item["id"] })
27662773
self.import_item(item, update, types, 0, work_id)
27672774
imported_elements.append({"id": item["id"], "type": item["type"]})
27682775

0 commit comments

Comments
 (0)