question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An example to use it for any log file.

See original GitHub issue

Hi, Thanks for making such an amazing project.

I have trying to use it for my log files. I could parse log files to its equivalent csv files using Logparser by LogPAI, but I have no idea how to convert logs to sequence of number as you have in you ~/data/hdfs/ directory. Also, then how to use it for inference real time log file.

Could please you help me with it?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
donglee-afarcommented, Apr 21, 2020

I will update the code and documentation on how to generate the sequence of number in the next few days.It will include two methods which depends on your own logs: Time sliding window and hard disk ID sequence window.

4reactions
kartikeyporwalcommented, Apr 24, 2020

Thanks alot for sharing your expertise.

I’ve gone through your code, I get your idea as (I am putting minute details so that it could be helpful to someone in future.)

  1. First gather all the logs which was obtained from normal execution of application, i.e., logs without errors.
  2. Combine these logs and convert to _structured.csv and _template.csv file using drain from logpai.
  3. Train the model using obtained _structured.csv from step 2.
  4. After successful training and saved model, it’s time to test the model’ s accuracy using a abnormal log file (log file with anomaly) and normal log file followed by inference of the model for the new logs files.
  5. To implement step 4, since log files will be different in the sequence of events, so obtaining _structured.csv and _template.csv file using drain will not make any sense as randomly generated event_id will be completely different for an event from generated event_id for same event from the log file used for training. So, you proposed structure_bgl.py, using which I can generate event_id for completely new logs based on the event_id of the logs used for training using the generated event_template. Further, sample_bgl.py will convert the structured log into sequence of event_id which can further be replaced by its equivalent integer and thus testing can be performed.
  6. Further to inference the model, new log line or logs lines in particular time window can be mapped with training file’s event_template to obtain event_id.

Could I figured it out correctly?

Please feel free to correct me if I failed to describe your approach.

Thanks for your time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Example log file - IBM
This log file was created using a LogLevel of 511. Lines with numbers displayed like 1 are annotations that are described following the...
Read more >
Log file - definition & overview - Sumo Logic
A log file is a computer-generated data file that contains information about usage patterns, activities, and operations within an operating system, application, ...
Read more >
Log Files: Definition, Types, and Importance | CrowdStrike
Log files are a historical record of everything and anything that happens within a system, including events such as transactions, errors and ...
Read more >
Log File: Definition, Types, Who Uses, Challenges and More
Log file analysis can be used to restrict access to a certain resource. Using the information in the log files, you can figure...
Read more >
Definition, utilities and examples of use of log file in computer ...
the chronological recording of the operations as they are performed; the file or database on which these recordings are stored. The simplest log,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found