Skip to content

Commit 3426a7c

Browse files
authored
Merge pull request #132 from splunk/additional_search_annotations
Note that the following appears for a non-deprecated search: <img width="1021" alt="image" src="https://github.com/splunk/contentctl/assets/87383215/2d471b6d-ec3a-46cd-be39-cddb81b5a417"> And for a deprecated search: <img width="1094" alt="image" src="https://github.com/splunk/contentctl/assets/87383215/2ac103bb-0108-4223-bf4a-7c5f91b50e06"> This change has also been ported/implemented with `@computed_field` in: dd4b150
2 parents 9cc8853 + 6c0b084 commit 3426a7c

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

contentctl/objects/abstract_security_content_objects/detection_abstract.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Detection_Abstract(SecurityContentObject):
5757
runtime: str = None
5858
enabled_by_default: bool = False
5959

60+
6061
class Config:
6162
use_enum_values = True
6263

@@ -346,3 +347,10 @@ def get_summary(
346347

347348
# Return the summary
348349
return summary_dict
350+
351+
352+
def getMetadata(self)->dict[str,str]:
353+
return {'detection_id':str(self.id),
354+
'deprecated':'1' if self.status==DetectionStatus.deprecated.value else '0',
355+
'detection_version':str(self.version)}
356+

contentctl/output/templates/savedsearches_detections.j2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ action.correlationsearch.label = {{APP_NAME}} - RIR - {{ detection.name }} - Rul
6464
action.correlationsearch.label = {{APP_NAME}} - {{ detection.name }} - Rule
6565
{% endif %}
6666
action.correlationsearch.annotations = {{ detection.annotations | tojson }}
67+
action.correlationsearch.metadata = {{ detection.getMetadata() | tojson }}
6768
{% if detection.deployment.scheduling.schedule_window is defined %}
6869
schedule_window = {{ detection.deployment.scheduling.schedule_window }}
6970
{% endif %}

0 commit comments

Comments
 (0)