Comments (6)
Drain will work well with floats even if you mask only integers because you will get a template like <NUM>.<NUM>
for floats in this case.
If you still want a float template, please check that you escape \
properly as \\
in the .ini
file.
from drain3.
@davidohana Thanks for your reply.
You mean that by using the "default" regexes in drain3.ini ?
By using those default regexes I can get a template with <NUM>.<NUM>
just for a few cases.
For example, for this sentence:
Rate of Change Rate 0.572213 Limit 0.1
the drained template is Rate of Change Rate <:*:> Limit <:*:>
And for this sentence:
Deviation Alarm Actual 954.4 Target 3
the drained template is Deviation Alarm Actual <:NUM:>.<:NUM:> Target <:NUM:>
The regex for in the default .ini file is: "((?<=[^A-Za-z0-9])|^)([\\-\\+]?\\d+)((?=[^A-Za-z0-9])|$)"
. Indeed, it works for both use cases if I use the regex in re.findall() but not with drain.
That's why I'm trying a new regex in the .ini file . I followed your tip and scaped \ in the .ini file:
{"regex_pattern":"(?<![a-zA-Z:])[-+]?\\d*\\.?\\d+", "mask_with": "FLO"},
Still no luck. Both regexes worked flawlessly with re.findall() but not in drain.
I'm trying to figure out what am I doing wrong.
from drain3.
The order of masks also matters.
Please put float mask before int masks. If some param occurrences are mixed - some float and some int, it can also cause this issue so you may need to capture both in the same mask regex.
from drain3.
Ok, I've figured out a regex that matches the floats, so I replaced the default one. But I still don't get why the default one does not work as expected for all my sentences. After a visual inspection, I think the default regex for numbers doesn't match negative floats.
from drain3.
If masking step produced something like
this is <:NUM:>
this is <:FLO:>
Then Drain step will merge those two into
this is <:*:>
from drain3.
If masking step produced something like
this is <:NUM:>
this is <:FLO:>
Then Drain step will merge those two into
this is <:*:>
Yes, I got it. But I was referring to using the default .ini file, with the default regexes, without adding or removing any regex. So I believe my sentences are matched by more than one regex in the default .ini so they get merged in the drain step.
from drain3.
Related Issues (20)
- What is the difference between drain3 with logstash in elasticsearch ?
- visualize drain parse tree (feature) HOT 1
- Hi, I've been trying to use drain for running log anomaly detection on some logs.
- Log Matching on new data HOT 2
- Chinese and English hybrid log template mining HOT 5
- Some DRAIN templates with <*> do not have parameters extracted HOT 7
- PermissionError when running with Persistance
- Is it possible to freeze templates when trainning? HOT 2
- Add a py.typed marker file
- `extra_delimiters` does not account for prefixed/suffixed delimiters
- Drain3 in golang HOT 2
- Masking Prefix and Suffix should not be escaped HOT 1
- A interesting issues. HOT 1
- big_file demo result's first cluster content is empty
- masking question,if i want to output the masking such as real info of the date,how can i putput
- Avoid creating many redis connections when you want to have seperate buckets of templates. HOT 2
- [Question] HOT 2
- one question, how to do Incremental learning in drain3 training?
- one question, how to do Incremental learning in drain3 training? HOT 6
- Release a new https://pypi.org/ version to update dependencies HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drain3.