detectmatelibrary 0.7.1__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. {detectmatelibrary-0.7.1/src/detectmatelibrary.egg-info → detectmatelibrary-0.7.2}/PKG-INFO +1 -1
  2. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/__init__.py +4 -0
  3. detectmatelibrary-0.7.2/src/detectmatelibrary/base_detectors/count_vector_detector.py +113 -0
  4. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/ecvc_detector.py +11 -78
  5. detectmatelibrary-0.7.2/src/detectmatelibrary/detectors/scvs_detector.py +41 -0
  6. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/metadata.py +1 -1
  7. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2/src/detectmatelibrary.egg-info}/PKG-INFO +1 -1
  8. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary.egg-info/SOURCES.txt +1 -0
  9. detectmatelibrary-0.7.1/src/detectmatelibrary/detectors/scvs_detector.py +0 -71
  10. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/LICENSE.md +0 -0
  11. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/README.md +0 -0
  12. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/pyproject.toml +0 -0
  13. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/setup.cfg +0 -0
  14. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/__init__.py +0 -0
  15. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/_testutils/__init__.py +0 -0
  16. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/_testutils/dummy_alert_aggregator.py +0 -0
  17. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/_testutils/dummy_detector.py +0 -0
  18. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/_testutils/dummy_parser.py +0 -0
  19. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/alert_aggregation/__init__.py +0 -0
  20. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/alert_aggregation/alertbert.py +0 -0
  21. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/alert_aggregation/basic_concat.py +0 -0
  22. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/alert_aggregation/logid_count.py +0 -0
  23. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/alert_aggregation/time_delta.py +0 -0
  24. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_alert_aggregation/__init__.py +0 -0
  25. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_alert_aggregation/density_clustering.py +0 -0
  26. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/_persist.py +0 -0
  27. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/_stability.py +0 -0
  28. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/_variable_hooks.py +0 -0
  29. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/deeplearning_detector.py +0 -0
  30. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/tracker_detector.py +0 -0
  31. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/base_detectors/variable_detector.py +0 -0
  32. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/__init__.py +0 -0
  33. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_config/__init__.py +0 -0
  34. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_config/_compile.py +0 -0
  35. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_config/_formats.py +0 -0
  36. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_core_op/_basic_component.py +0 -0
  37. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_core_op/_fed_component.py +0 -0
  38. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_core_op/_fit_logic.py +0 -0
  39. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_core_op/_schema_pipeline.py +0 -0
  40. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/_core_op/_train_buffer.py +0 -0
  41. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/alert_aggregator.py +0 -0
  42. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/core.py +0 -0
  43. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/detector.py +0 -0
  44. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/common/parser.py +0 -0
  45. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/constants.py +0 -0
  46. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/__init__.py +0 -0
  47. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/bigram_frequency_detector.py +0 -0
  48. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/charset_detector.py +0 -0
  49. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/deeplog_detector.py +0 -0
  50. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/event_sequence_detector.py +0 -0
  51. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/logbert_detector.py +0 -0
  52. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/new_event_detector.py +0 -0
  53. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/new_value_combo_detector.py +0 -0
  54. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/new_value_detector.py +0 -0
  55. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/random_detector.py +0 -0
  56. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/rule_detector.py +0 -0
  57. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/detectors/value_range_detector.py +0 -0
  58. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/helper/from_to.py +0 -0
  59. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/helper/select_component.py +0 -0
  60. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/__init__.py +0 -0
  61. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/autoparser.py +0 -0
  62. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/drain.py +0 -0
  63. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/json_parser.py +0 -0
  64. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/__init__.py +0 -0
  65. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/__init__.py +0 -0
  66. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/additional_cluster.py +0 -0
  67. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/cluster.py +0 -0
  68. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/matching.py +0 -0
  69. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/parser.py +0 -0
  70. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/parsing_base.py +0 -0
  71. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/parsing_cache.py +0 -0
  72. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/postprocess.py +0 -0
  73. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/sample.py +0 -0
  74. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/util.py +0 -0
  75. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/engine/vars.py +0 -0
  76. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/logbatcher/parser.py +0 -0
  77. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/template_matcher/__init__.py +0 -0
  78. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/template_matcher/_matcher_op.py +0 -0
  79. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/template_matcher/_parser.py +0 -0
  80. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/parsers/tree_matcher.py +0 -0
  81. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/pipeline.py +0 -0
  82. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/__init__.py +0 -0
  83. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/_classes.py +0 -0
  84. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/connectors/__init__.py +0 -0
  85. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/connectors/default.py +0 -0
  86. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/connectors/mongos.py +0 -0
  87. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/connectors/redis.py +0 -0
  88. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/protobuf/_op.py +0 -0
  89. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/schemas/protobuf/schemas_pb2.py +0 -0
  90. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/__init__.py +0 -0
  91. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/logging.py +0 -0
  92. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/__init__.py +0 -0
  93. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/create_workspace.py +0 -0
  94. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/CustomAlertAggregator.py +0 -0
  95. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/CustomDetector.py +0 -0
  96. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/CustomParser.py +0 -0
  97. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/__init__.py +0 -0
  98. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/data/__init__.py +0 -0
  99. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/data/alerts.json +0 -0
  100. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/data/logs.json +0 -0
  101. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/data/parsed_log.json +0 -0
  102. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/test_templates/__init__.py +0 -0
  103. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/test_templates/test_CustomAlertAggregator.py +0 -0
  104. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/test_templates/test_CustomDetector.py +0 -0
  105. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/templates/test_templates/test_CustomParser.py +0 -0
  106. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/tools/workspace/utils.py +0 -0
  107. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/alertbert/datasets.py +0 -0
  108. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/alertbert/models.py +0 -0
  109. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/alertbert/preprocessing.py +0 -0
  110. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/aux.py +0 -0
  111. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/data_buffer.py +0 -0
  112. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/deep_learning/_op.py +0 -0
  113. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/deep_learning/deeplog.py +0 -0
  114. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/deep_learning/imodel.py +0 -0
  115. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/deep_learning/logbert.py +0 -0
  116. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/finetune.py +0 -0
  117. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/id_generator.py +0 -0
  118. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/key_extractor.py +0 -0
  119. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/log_format_utils.py +0 -0
  120. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/__init__.py +0 -0
  121. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/basic_persistency.py +0 -0
  122. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/base.py +0 -0
  123. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/__init__.py +0 -0
  124. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/base/__init__.py +0 -0
  125. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/base/event_tracker.py +0 -0
  126. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/base/multi_tracker.py +0 -0
  127. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/base/single_tracker.py +0 -0
  128. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/rle_list.py +0 -0
  129. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/stability/__init__.py +0 -0
  130. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/stability/classification_methods.py +0 -0
  131. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/stability/stability_classifier.py +0 -0
  132. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/data_structures/trackers/stability/stability_tracker.py +0 -0
  133. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/event_persistency.py +0 -0
  134. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/persistency_saver.py +0 -0
  135. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/persistency/slow_persistency.py +0 -0
  136. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/preview_helpers.py +0 -0
  137. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/sequence_encoding.py +0 -0
  138. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary/utils/time_format_handler.py +0 -0
  139. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary.egg-info/dependency_links.txt +0 -0
  140. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary.egg-info/entry_points.txt +0 -0
  141. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary.egg-info/requires.txt +0 -0
  142. {detectmatelibrary-0.7.1 → detectmatelibrary-0.7.2}/src/detectmatelibrary.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: detectmatelibrary
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: DetectMate Library for log processing components
5
5
  Author: André García Gómez, Viktor Beck, Thorina Boenke, Wolfgang Hotwagner, Anna Erdi, Ernst Leierzopf, Lukas Karner
6
6
  License-Expression: EUPL-1.2
@@ -9,6 +9,7 @@ from detectmatelibrary.utils.persistency.data_structures.trackers.stability.stab
9
9
  SingleStabilityTracker,
10
10
  )
11
11
 
12
+ from .count_vector_detector import CountVectorDetector, CountVectorDetectorConfig, SessionWindows
12
13
  from ._persist import PersistConfig
13
14
  from .deeplearning_detector import DeepLearningDetector, DeepLearningDetectorConfig
14
15
  from ._stability import StabilityAutoConfigParams
@@ -16,10 +17,13 @@ from .tracker_detector import TrackerDetector, TrackerDetectorConfig
16
17
  from .variable_detector import VariableAutoConfigParams, VariableDetector, VariableDetectorConfig
17
18
 
18
19
  __all__ = [
20
+ "CountVectorDetector",
21
+ "CountVectorDetectorConfig",
19
22
  "DeepLearningDetector",
20
23
  "DeepLearningDetectorConfig",
21
24
  "EventStabilityTracker",
22
25
  "PersistConfig",
26
+ "SessionWindows",
23
27
  "SingleStabilityTracker",
24
28
  "StabilityAutoConfigParams",
25
29
  "TrackerDetector",
@@ -0,0 +1,113 @@
1
+ from typing import List, Sequence
2
+ from typing_extensions import override
3
+
4
+ from detectmatelibrary import schemas
5
+ from detectmatelibrary.utils.data_buffer import ArgsBuffer, BufferMode, DataBuffer
6
+ from detectmatelibrary.utils.sequence_encoding import (
7
+ count_events,
8
+ decode_count_vec,
9
+ encode_count_vec,
10
+ warn_on_window_size_mismatch,
11
+ )
12
+
13
+ from pydantic import Field
14
+
15
+ from .tracker_detector import TrackerDetector, TrackerDetectorConfig
16
+
17
+
18
+ class SessionWindows:
19
+ """The window ending at the latest event of each session: its last `size`
20
+ events, fewer at the session start."""
21
+
22
+ def __init__(self, size: int) -> None:
23
+ self.size = size
24
+ self.windows: dict[str, tuple[int, ...]] = {}
25
+
26
+ def add(self, session: str, event: int) -> tuple[int, ...]:
27
+ """Add ``event`` to ``session`` and return the session's window ending
28
+ at it."""
29
+ window = (self.windows.get(session, ()) + (event,))[-self.size:]
30
+ self.windows[session] = window
31
+ return window
32
+
33
+
34
+ class CountVectorDetectorConfig(TrackerDetectorConfig):
35
+ window_size: int = Field(
36
+ default=10,
37
+ description="Length of the event-ID window a count vector is built over.",
38
+ )
39
+ session_variable: str | None = Field(
40
+ default=None,
41
+ description=(
42
+ "Header variable that names the session of each event (HDFS: block_id). When set, "
43
+ "an event's window holds the last window_size events of its own session, fewer at "
44
+ "the session start, so windows never mix sessions and every event is checked."
45
+ ),
46
+ )
47
+
48
+
49
+ class CountVectorDetector(TrackerDetector):
50
+ """Base of the detectors that learn the count vectors of event-ID
51
+ windows."""
52
+
53
+ def __init__(self, name: str, config: CountVectorDetectorConfig) -> None:
54
+ self.config: CountVectorDetectorConfig
55
+
56
+ by_session = config.session_variable is not None
57
+ super().__init__(
58
+ name=name,
59
+ config=config,
60
+ buffer_mode=BufferMode.NO_BUF if by_session else BufferMode.WINDOW,
61
+ buffer_size=None if by_session else config.window_size,
62
+ )
63
+ # With sessions, train() keeps its own windows: it also gets the configure records,
64
+ # replayed after the configure phase. detect() does not get them, so its windows are
65
+ # built where every record passes once, the buffer.
66
+ self.train_windows = SessionWindows(config.window_size)
67
+ self.detect_windows = SessionWindows(config.window_size)
68
+ self.window: tuple[int, ...] = ()
69
+ if by_session:
70
+ self.args_buffer = ArgsBuffer(BufferMode.NO_BUF, process_function=self._add_to_session)
71
+ self.data_buffer = DataBuffer(self.args_buffer)
72
+
73
+ def _session(self, input_: schemas.ParserSchema) -> str:
74
+ session = input_["headerVariables"].get(self.config.session_variable)
75
+ if session is None:
76
+ raise ValueError(f"<<{self.name}>> log has no header variable {self.config.session_variable!r}")
77
+ return str(session)
78
+
79
+ def _add_to_session(self, input_: schemas.ParserSchema) -> schemas.ParserSchema:
80
+ self.window = self.detect_windows.add(self._session(input_), input_["eventID"])
81
+ return input_
82
+
83
+ def window_events(self, input_: List[schemas.ParserSchema] | schemas.ParserSchema) -> Sequence[int]:
84
+ """Event IDs of the window of ``input_``."""
85
+ if isinstance(input_, list):
86
+ return [in_["eventID"] for in_ in input_]
87
+ return self.window
88
+
89
+ @override
90
+ def _sync_from_state(self) -> None:
91
+ warn_on_window_size_mismatch(self.name, self.persistency.get_events_seen(), self.config.window_size)
92
+
93
+ def train(self, input_: List[schemas.ParserSchema] | schemas.ParserSchema) -> None:
94
+ if isinstance(input_, list):
95
+ events: Sequence[int] = [in_["eventID"] for in_ in input_]
96
+ last = input_[-1]
97
+ else:
98
+ events, last = self.train_windows.add(self._session(input_), input_["eventID"]), input_
99
+ self._ingest(
100
+ event_id=encode_count_vec(self.config.window_size, count_events(events)),
101
+ input_=last,
102
+ variables={}
103
+ )
104
+
105
+ def post_train(self) -> None:
106
+ self.train_windows = SessionWindows(self.config.window_size)
107
+
108
+ def get_known_count_vecs(self) -> set[tuple[int, ...]]:
109
+ """Return the count vectors learned during training."""
110
+ return {
111
+ decode_count_vec(str(encoded))[1]
112
+ for encoded in self.persistency.get_events_seen()
113
+ }
@@ -2,15 +2,11 @@ from typing import Any, Collection, List, Sequence
2
2
  from typing_extensions import Self, override
3
3
  import warnings
4
4
 
5
- from detectmatelibrary.base_detectors import TrackerDetector, TrackerDetectorConfig
6
-
7
- from detectmatelibrary.utils.data_buffer import ArgsBuffer, BufferMode, DataBuffer
5
+ from detectmatelibrary.base_detectors import CountVectorDetector, CountVectorDetectorConfig
6
+ from detectmatelibrary.base_detectors.count_vector_detector import SessionWindows
8
7
  from detectmatelibrary.utils.sequence_encoding import (
9
8
  build_count_vec,
10
- count_events,
11
9
  decode_count_vec,
12
- encode_count_vec,
13
- warn_on_window_size_mismatch,
14
10
  )
15
11
  from detectmatelibrary import schemas
16
12
 
@@ -19,6 +15,9 @@ import numpy as np
19
15
  from pydantic import Field
20
16
 
21
17
 
18
+ __all__ = ["ECVCDetector", "ECVCDetectorConfig", "ECVCOp", "SessionWindows"]
19
+
20
+
22
21
  class ECVCOp:
23
22
  build_count_vec = staticmethod(build_count_vec)
24
23
 
@@ -72,34 +71,14 @@ class ECVCOp:
72
71
  raise Exception("Method not supported")
73
72
 
74
73
 
75
- class SessionWindows:
76
- """The window ending at the latest event of each session: its last `size`
77
- events, fewer at the session start."""
78
-
79
- def __init__(self, size: int) -> None:
80
- self.size = size
81
- self.windows: dict[str, tuple[int, ...]] = {}
82
-
83
- def add(self, session: str, event: int) -> tuple[int, ...]:
84
- """Add ``event`` to ``session`` and return the session's window ending
85
- at it."""
86
- window = (self.windows.get(session, ()) + (event,))[-self.size:]
87
- self.windows[session] = window
88
- return window
89
-
90
-
91
74
  # method_type this detector used before it was corrected; still accepted.
92
75
  _LEGACY_METHOD_TYPE = "ecvc_detector_detector"
93
76
 
94
77
 
95
- class ECVCDetectorConfig(TrackerDetectorConfig):
78
+ class ECVCDetectorConfig(CountVectorDetectorConfig):
96
79
  method_type: str = Field(
97
80
  default="ecvc_detector", description="Indicates what type of method it is."
98
81
  )
99
- window_size: int = Field(
100
- default=10,
101
- description="Length of the event-ID window a count vector is built over.",
102
- )
103
82
  validation_per: float = Field(
104
83
  default=0.2,
105
84
  description=(
@@ -120,14 +99,6 @@ class ECVCDetectorConfig(TrackerDetectorConfig):
120
99
  "fixed threshold of 0."
121
100
  ),
122
101
  )
123
- session_variable: str | None = Field(
124
- default=None,
125
- description=(
126
- "Header variable that names the session of each event (HDFS: block_id). When set, "
127
- "an event's window holds the last window_size events of its own session, fewer at "
128
- "the session start, so windows never mix sessions and every event is checked."
129
- ),
130
- )
131
102
 
132
103
  @classmethod
133
104
  def from_dict(cls, data: dict[str, Any], method_id: str) -> Self:
@@ -145,7 +116,7 @@ class ECVCDetectorConfig(TrackerDetectorConfig):
145
116
  return super().from_dict(data, method_id)
146
117
 
147
118
 
148
- class ECVCDetector(TrackerDetector):
119
+ class ECVCDetector(CountVectorDetector):
149
120
  # Class-level defaults: _sync_from_state runs inside TrackerDetector.__init__.
150
121
  count_vecs: np.ndarray | None = None
151
122
  known_vecs: frozenset[bytes] = frozenset() # vec_key of each row of count_vecs
@@ -159,52 +130,14 @@ class ECVCDetector(TrackerDetector):
159
130
 
160
131
  if isinstance(config, dict):
161
132
  config = ECVCDetectorConfig.from_dict(config, name)
133
+ super().__init__(name=name, config=config)
162
134
  self.config: ECVCDetectorConfig
163
135
 
164
- by_session = config.session_variable is not None
165
- super().__init__(
166
- name=name,
167
- config=config,
168
- buffer_mode=BufferMode.NO_BUF if by_session else BufferMode.WINDOW,
169
- buffer_size=None if by_session else config.window_size,
170
- )
171
- # With sessions, train() keeps its own windows: it also gets the configure records,
172
- # replayed after the configure phase. detect() does not get them, so its windows are
173
- # built where every record passes once, the buffer.
174
- self.train_windows = SessionWindows(config.window_size)
175
- self.detect_windows = SessionWindows(config.window_size)
176
- self.window: tuple[int, ...] = ()
177
- if by_session:
178
- self.args_buffer = ArgsBuffer(BufferMode.NO_BUF, process_function=self._add_to_session)
179
- self.data_buffer = DataBuffer(self.args_buffer)
180
-
181
- def _session(self, input_: schemas.ParserSchema) -> str:
182
- session = input_["headerVariables"].get(self.config.session_variable)
183
- if session is None:
184
- raise ValueError(f"<<{self.name}>> log has no header variable {self.config.session_variable!r}")
185
- return str(session)
186
-
187
- def _add_to_session(self, input_: schemas.ParserSchema) -> schemas.ParserSchema:
188
- self.window = self.detect_windows.add(self._session(input_), input_["eventID"])
189
- return input_
190
-
191
136
  @override
192
137
  def _sync_from_state(self) -> None:
193
- warn_on_window_size_mismatch(self.name, self.persistency.get_events_seen(), self.config.window_size)
138
+ super()._sync_from_state()
194
139
  self.build_count_vec() # no-op while no count vectors are stored
195
140
 
196
- def train(self, input_: List[schemas.ParserSchema] | schemas.ParserSchema) -> None:
197
- if isinstance(input_, list):
198
- events: Sequence[int] = [in_["eventID"] for in_ in input_]
199
- last = input_[-1]
200
- else:
201
- events, last = self.train_windows.add(self._session(input_), input_["eventID"]), input_
202
- self._ingest(
203
- event_id=encode_count_vec(self.config.window_size, count_events(events)),
204
- input_=last,
205
- variables={}
206
- )
207
-
208
141
  def build_count_vec(self) -> None:
209
142
  seqs = sorted(
210
143
  decode_count_vec(str(encoded))[1]
@@ -229,7 +162,7 @@ class ECVCDetector(TrackerDetector):
229
162
 
230
163
  def post_train(self) -> None:
231
164
  self.build_count_vec()
232
- self.train_windows = SessionWindows(self.config.window_size)
165
+ super().post_train()
233
166
 
234
167
  def detect(
235
168
  self,
@@ -240,7 +173,7 @@ class ECVCDetector(TrackerDetector):
240
173
  if self.count_vecs is None:
241
174
  return False
242
175
 
243
- events = [in_["eventID"] for in_ in input_] if isinstance(input_, list) else self.window
176
+ events = self.window_events(input_)
244
177
  y = ECVCOp.events_vec(events, self.count_vecs.shape[1])
245
178
  # A window equal to a learned vector scores 0, which never exceeds the threshold.
246
179
  if ECVCOp.vec_key(y) in self.known_vecs:
@@ -0,0 +1,41 @@
1
+ from typing import Any, List
2
+
3
+ from detectmatelibrary.base_detectors import CountVectorDetector, CountVectorDetectorConfig
4
+ from detectmatelibrary.utils.sequence_encoding import count_events, encode_count_vec
5
+ from detectmatelibrary import schemas
6
+
7
+ from pydantic import Field
8
+
9
+
10
+ class SCVSDetectorConfig(CountVectorDetectorConfig):
11
+ method_type: str = Field(
12
+ default="scvs_detector", description="Indicates what type of method it is."
13
+ )
14
+
15
+
16
+ class SCVSDetector(CountVectorDetector):
17
+ def __init__(
18
+ self,
19
+ name: str = "SCVSDetector",
20
+ config: SCVSDetectorConfig | dict[str, Any] = SCVSDetectorConfig(),
21
+ ) -> None:
22
+
23
+ if isinstance(config, dict):
24
+ config = SCVSDetectorConfig.from_dict(config, name)
25
+ super().__init__(name=name, config=config)
26
+ self.config: SCVSDetectorConfig
27
+
28
+ def detect(
29
+ self,
30
+ input_: List[schemas.ParserSchema] | schemas.ParserSchema,
31
+ output_: schemas.DetectorSchema,
32
+ ) -> bool:
33
+
34
+ events = self.window_events(input_)
35
+ key = encode_count_vec(self.config.window_size, count_events(events))
36
+ if key not in self.persistency.get_events_seen():
37
+ output_["score"] = 1.
38
+ output_["description"] = "Count vector not found"
39
+ return True
40
+
41
+ return False
@@ -7,6 +7,6 @@ __deprecated__ = False
7
7
  __website__ = "https://aecid.ait.ac.at"
8
8
  __license__ = "EUPL-1.2"
9
9
  __status__ = "Development"
10
- __version__ = "0.7.1"
10
+ __version__ = "0.7.2"
11
11
  __all__ = ['__authors__', '__contact__', '__copyright__', '__date__', '__deprecated__', '__website__',
12
12
  '__license__', '__status__', '__version__']
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: detectmatelibrary
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: DetectMate Library for log processing components
5
5
  Author: André García Gómez, Viktor Beck, Thorina Boenke, Wolfgang Hotwagner, Anna Erdi, Ernst Leierzopf, Lukas Karner
6
6
  License-Expression: EUPL-1.2
@@ -26,6 +26,7 @@ src/detectmatelibrary/base_detectors/__init__.py
26
26
  src/detectmatelibrary/base_detectors/_persist.py
27
27
  src/detectmatelibrary/base_detectors/_stability.py
28
28
  src/detectmatelibrary/base_detectors/_variable_hooks.py
29
+ src/detectmatelibrary/base_detectors/count_vector_detector.py
29
30
  src/detectmatelibrary/base_detectors/deeplearning_detector.py
30
31
  src/detectmatelibrary/base_detectors/tracker_detector.py
31
32
  src/detectmatelibrary/base_detectors/variable_detector.py
@@ -1,71 +0,0 @@
1
- from typing import Any, List
2
-
3
- from detectmatelibrary.base_detectors import TrackerDetector, TrackerDetectorConfig
4
-
5
- from detectmatelibrary.utils.data_buffer import BufferMode
6
- from detectmatelibrary.utils.sequence_encoding import (
7
- build_count_vec,
8
- decode_count_vec,
9
- encode_count_vec,
10
- warn_on_window_size_mismatch,
11
- )
12
- from detectmatelibrary import schemas
13
-
14
- from pydantic import Field
15
- from typing_extensions import override
16
-
17
-
18
- class SCVSDetectorConfig(TrackerDetectorConfig):
19
- method_type: str = Field(
20
- default="scvs_detector", description="Indicates what type of method it is."
21
- )
22
- window_size: int = Field(
23
- default=10,
24
- description="Length of the event-ID window a count vector is built over.",
25
- )
26
-
27
-
28
- class SCVSDetector(TrackerDetector):
29
- def __init__(
30
- self,
31
- name: str = "SCVSDetector",
32
- config: SCVSDetectorConfig | dict[str, Any] = SCVSDetectorConfig(),
33
- ) -> None:
34
-
35
- if isinstance(config, dict):
36
- config = SCVSDetectorConfig.from_dict(config, name)
37
- self.config: SCVSDetectorConfig
38
-
39
- super().__init__(
40
- name=name, config=config, buffer_mode=BufferMode.WINDOW, buffer_size=config.window_size
41
- )
42
-
43
- @override
44
- def _sync_from_state(self) -> None:
45
- warn_on_window_size_mismatch(self.name, self.persistency.get_events_seen(), self.config.window_size)
46
-
47
- def train(self, input_: List[schemas.ParserSchema]) -> None: # type: ignore
48
- self._ingest(
49
- event_id=encode_count_vec(self.config.window_size, build_count_vec(input_)),
50
- input_=input_[-1],
51
- variables={}
52
- )
53
-
54
- def detect(
55
- self, input_: List[schemas.ParserSchema], output_: schemas.DetectorSchema, # type: ignore
56
- ) -> bool:
57
-
58
- key = encode_count_vec(self.config.window_size, build_count_vec(input_))
59
- if key not in self.persistency.get_events_seen():
60
- output_["score"] = 1.
61
- output_["description"] = "Count vector not found"
62
- return True
63
-
64
- return False
65
-
66
- def get_known_count_vecs(self) -> set[tuple[int, ...]]:
67
- """Return the count vectors learned during training."""
68
- return {
69
- decode_count_vec(str(encoded))[1]
70
- for encoded in self.persistency.get_events_seen()
71
- }