Giter Site home page Giter Site logo

Comments (4)

davidohana avatar davidohana commented on July 21, 2024

Hello,
What do you mean by "previous results"?
Can you provide an example of your need?

from drain3.

stianvale avatar stianvale commented on July 21, 2024

Hi @davidohana, and thanks for replying!

I'm using Drain for feature generation for a machine learning case. I have a dataframe of log messages that I run through Drain to extract the patterns and categorize log messages. I then add these features to the dataframe.

Let's say I have one row with the log message 'aa aa aa' and then later on 'aa aa ab' as in your example in the readme.
When Drain sees 'aa aa ab' after having seen 'aa aa aa', it learns that the template is actually 'aa aa <*>'.

My preprocessing of 'aa aa aa' will still hold the template 'aa aa aa', but what I want to do now is to update this with the new template.

I could of course keep track of the cluster_id's and just update them manually after every 'cluster_template_changed', but I'm just wondering if there's some built-in logic in this library that can enable me to take care of this more efficiently.

Does that make sense?

from drain3.

davidohana avatar davidohana commented on July 21, 2024

It is recommended to track clusters by the cluster ID and not the template, exactly because of this issue.

Look at the following sample output:

Starting Drain3 template miner
Checking for saved state
Saved state not found
Drain3 started with 'FILE' persistence
reading from std-in (input 'q' to finish)
aa aa aa
Saving state of 1 clusters with 1 messages, 952 bytes, reason: cluster_created (1)
{"change_type": "cluster_created", "cluster_id": 1, "cluster_size": 1, "template_mined": "aa aa aa", "cluster_count": 1}
parameters: []
aa aa ab
Saving state of 1 clusters with 2 messages, 1052 bytes, reason: cluster_template_changed (1)
{"change_type": "cluster_template_changed", "cluster_id": 1, "cluster_size": 2, "template_mined": "aa aa <:*:>", "cluster_count": 1}
parameters: ['ab']
aa aa cc
{"change_type": "none", "cluster_id": 1, "cluster_size": 3, "template_mined": "aa aa <:*:>", "cluster_count": 1}
parameters: ['cc']

The cluster_id stays 1 but template_mined changes.
Indeed if you save some repository of cluster ID to template mapping, you can update it after each cluster_template_changed event.

BTW this is one of the differences from the original Drain. which identifies clusters by the hash code of the template ID.

from drain3.

stianvale avatar stianvale commented on July 21, 2024

Thanks a lot @davidohana, that perfectly explains it! If I would need the 'template_mined' further, then I'll just update the previous entries based on their 'cluster_id'.

Closing the question, thanks a lot!

from drain3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.