Refactor common and goodbye readers....#55
Conversation
ipmach
commented
Feb 11, 2026
- Minor refactor main structure
- Removal of readers
- Removal of outputs
- Added From, To and FromTo library to support file reads from multiple formats for the different components.
Use CaseTwo examples of how to load and save data. Methods use detector = DummyDetector()
parser = DummyParser()Standard useLoad data from a log file. for parsed_log in From.log(parser, in_path=log_path):
alerts.append(detector.process(parsed_log))or run them independently: for parsed_log in From.log(parser, in_path=log_path):
parsed_logs.append(parsed_log)
for parsed_log in parsed_logs:
To.json(detector.process(parsed_log), out_path=temp1)Debug useWe want to save the data in every step for parsed_log in FromTo.log2json(parser, in_path=log_path, out_path=temp1):
pass
for alerts in FromTo.json2json(detector, in_path=temp1, out_path=temp2):
pass |
|
@viktorbeck98 can you review this PR? |
viktorbeck98
left a comment
There was a problem hiding this comment.
I left a comment for src/detectmatelibrary/utils/from_to.py. Looks good!
There was a problem hiding this comment.
I like the functionality and the names but I am unsure whether the file location fits. This is more supposed to be a helper class for the developer / library user use case., no? @ipmach what do you think?
There was a problem hiding this comment.
Mm... yes. Should we create a helper folder? @viktorbeck98
There was a problem hiding this comment.
but following that logic, shouldn't be the persistency the same?
There was a problem hiding this comment.
Just posting here again: Persistency will be used a lot in the detectors, whereas from_to.py will not, so that's where I would differ