Giter VIP home page Giter VIP logo

Comments (4)

HelenGuohx avatar HelenGuohx commented on July 17, 2024 1

Try this in
process_tbird.sh
--regex "$REGEX1" "$REGEX2" "$REGEX3" "$REGEX4"
data_process.py

parser.add_argument("--regex", nargs='*', help="regex to clean log messages", default='')

from logbert.

ChangNamAn avatar ChangNamAn commented on July 17, 2024

Hi,

I found the correct way when I checked the original Drain_demo.py. (https://github.com/logpai/logparser/blob/master/demo/Drain_demo.py)

Regular expression list for optional preprocessing (default: [])
regex = [
r'blk_(|-)[0-9]+' , # block id
r'(/|)([0-9]+.){3}[0-9]+(:[0-9]+|)(:|)', # IP
r'(?<=[^A-Za-z0-9])(-?+?\d+)(?=[^A-Za-z0-9])|[0-9]+$', # Numbers
]
st = 0.5 # Similarity threshold
depth = 4 # Depth of all leaf nodes

parser = Drain.LogParser(log_format, indir=input_dir, outdir=output_dir, depth=depth, st=st, rex=regex)
parser.parse(log_file)

--regex="$REGEX1 $REGEX2 $REGEX3 $REGEX4" is passed the value as 1 size of list.

Please check it.

from logbert.

HelenGuohx avatar HelenGuohx commented on July 17, 2024

Thank you for letting me know. I used nargs='*' in argparse to receive multiple inputs as list (check this for usage ). But I should use --regex $REGEX1 $REGEX2 $REGEX3 instead of --regex="$REGEX1 $REGEX2 $REGEX3" in shell scripts

from logbert.

ChangNamAn avatar ChangNamAn commented on July 17, 2024

Not covered REGEX3='(?<=Warning: we failed to resolve data source name )[\w\s]+'
argparse is processing it to
['(0x)[0-9a-fA-F]+', '\d+.\d+.\d+.\d+', '(?<=Warning:', 'we', 'failed', 'to', 'resolve', 'data', 'source', 'name', ')[\w\s]+', '\d+']

from logbert.

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.