Problem in FixedWordlistDataModelElement.py if a list element is equal to the beginning of another element
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
logdata-anomaly-miner - lightweight tool for log checking, log analysis |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Example Parser:
model=SequenceM
FixedWordli
FixedDataMo
])
Line:
aa d
Output:
Unparsed atom received
The problem in FixWordlistData
/model/
/model/
My workaround to that problem was generating a temporary list, which I sorted by the length of the elements starting with the longest and returning as 'wordPos' the position of the element in the original list. The code looks as follows:
import MatchElement
class FixedWordlistDa
def __init__(self, id, wordlist):
self.id=id
self.
def getChildElement
return(None)
def getMatchElement
"""@return None when there is no match, MatchElement otherwise."""
data=
tmp_wordlist = self.wordlist[:]
tmp_
matchData=None
wordPos=0
for word in tmp_wordlist:
if data.startswith
wordPos = self.wordlist.
break
wordPos+=1
if matchData == None: return(None)
matchContex
return(
matchData, wordPos, None))
Changed in logdata-anomaly-miner: | |
status: | Fix Committed → Fix Released |
As index in wordlist is the result of the match, resorting after creating the model element is not an option. Hence the wordlist has to have correct shape beforehand.
Done:
* Updated module documentation to state relevance of sorting for model element output
* Added check to constructor to verify, that wordlist has sane structure before using it
See /git.launchpad. net/logdata- anomaly- miner/commit/ ?id=6a7cf565003 4ed62833f05bf91 ce7afc6c2660dd
https:/