MCPcopy Create free account
hub / github.com/WraySmith/log-anomaly / SimpleLoopMatch

Method SimpleLoopMatch

parse/logparser/Spell/Spell.py:80–89  ·  view source on GitHub ↗
(self, logClustL, seq)

Source from the content-addressed store, hash-verified

78 return result
79
80 def SimpleLoopMatch(self, logClustL, seq):
81 for logClust in logClustL:
82 if float(len(logClust.logTemplate)) < 0.5 * len(seq):
83 continue
84 # Check the template is a subsequence of seq (we use set checking as a proxy here for speedup since
85 # incorrect-ordering bad cases rarely occur in logs)
86 token_set = set(seq)
87 if all(token in token_set or token == '<*>' for token in logClust.logTemplate):
88 return logClust
89 return None
90
91 def PrefixTreeMatch(self, parentn, seq, idx):
92 retLogClust = None

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected