Skip to content

Commit

Permalink
Refactor pre_detector
Browse files Browse the repository at this point in the history
  • Loading branch information
ppcad committed Sep 22, 2023
1 parent 56ce3f9 commit f7a7497
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions logprep/processor/pre_detector/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,10 @@ def _apply_rules(self, event, rule):
if self._logger.isEnabledFor(DEBUG): # pragma: no cover
self._logger.debug(f"{self.describe()} processing matching event")
self._get_detection_result(rule, self._extra_data)
if "@timestamp" in event:
for detection in self._extra_data:
detection["@timestamp"] = event["@timestamp"]
for detection in self._extra_data:
detection["creation_timestamp"] = TimeParser.now().isoformat()
if "@timestamp" in event:
detection["@timestamp"] = event["@timestamp"]

def _get_detection_result(self, rule: PreDetectorRule, detection_results: list):
if self._event.get("pre_detection_id") is None:
Expand Down

0 comments on commit f7a7497

Please sign in to comment.