loglead

LogLead stands for Log Loader, Enhancer, and Anomaly Detector.

https://github.com/evotestops/loglead

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.7%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

LogLead stands for Log Loader, Enhancer, and Anomaly Detector.

Basic Info
  • Host: GitHub
  • Owner: EvoTestOps
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 15.5 MB
Statistics
  • Stars: 24
  • Watchers: 3
  • Forks: 1
  • Open Issues: 17
  • Releases: 8
Created over 2 years ago · Last pushed 10 months ago
Metadata Files
Readme License Citation

README.md

LogLead

LogLead is designed to efficiently benchmark log anomaly detection algorithms and log representations.

Currently, it features nearly 1,000 unique anomaly detection combinations, encompassing 8 public datasets, 11 log representations (enhancers), and 11 classifiers. These resources enable you to benchmark your own data, log representation, or classifier against a diverse range of scenarios. LogLead is an actively evolving project, and we are continually adding new datasets, representations, and classifiers. If there's something you believe should be included, please submit a request for a dataset, enhancer, or classifier in the issue tracker.

A key strength of LogLead is its custom loader system, which efficiently isolates the unique aspects of logs from different systems. This design allows for a reduction in redundant code, as the same enhancement and anomaly detection code can be applied universally once the logs are loaded.

Installing LogLead

Install with pip:

python -m pip install loglead Then clone the project, move to demo folder and run some demos git clone https://github.com/EvoTestOps/LogLead.git cd LogLead/demo python HDFS_samples.py python TB_samples.py To start working with your own data, it is easiest to begin with the RawLoader. To try out RawLoader, run the RawLoaderDemo. For this, you will need the original BGL and HDFS datasets. You will also need to edit the RawLoaderDemo script or add a ".env" file to your LogLead root so that the demo knows where the data is located on your machine. See .env.sample as an example of how the ".env" file should look. After that run the demo python RawLoader_NoLabels.py Finally, you can try downloading all data with DownLoadData. Configuration file controls what gets loaded and also how are they used in testing in case you also run the tests.
cd LogLead/tests python download_data.py

Known issues

  • If scikit-learn wheel fails to compile, check that you can gcc and g++ installed.
  • pip version does not have the tensorflow dependencies necessary for BertEmbeddings. Install them manually (preferably in a conda enviroment).

Demos

In the following demonstrations, you'll notice a significant aspect of LogLead's design efficiency: code reusability. Both demos, while analyzing different datasets, share a substantial amount of their underlying code. This not only showcases LogLead's versatility in handling various log formats but also its ability to streamline the analysis process through reusable code components.

Thunderbird Supercomputer Log Demo

  • Script: TB_samples.py
  • Description: This demo presents a Thunderbird supercomputer log, labeled at the line (event) level. A first column marked with “-” indicates normal behavior, while other markings represent anomalies.
  • Log Snapshot: View the log here.
  • Dataset: The demo includes a parquet file containing a subset of 263,408 log events, with 21,955 anomalies.
  • Screencast: For an overview of the demo, watch our 5-minute screencast on YouTube.

    Hadoop Distributed File System (HDFS) Log Demo

  • Script: HDFS_samples.py

  • Description: This demo showcases logs from the Hadoop Distributed File System (HDFS), labeled at the sequence level (a sequence is a collection of multiple log events).

  • Log Snapshot: View the log here.

  • Anomaly Labels: Provided in a separate file.

  • Dataset: The demo includes a parquet file containing a subset of 222,579 log events, forming 11,501 sequences with 350 anomalies.

Example of Anomaly Detection results

Below you can see anomaly detection results (F1-Binary) trained on 0.5% subset of HDFS data. We use 5 different log message enhancement strategies: Words, Drain, LenMa, Spell, and BERT

The enhancement strategies are tested with 5 different machine learning algorithms: DT (Decision Tree), SVM (Support Vector Machine), LR (Logistic Regression), RF (Random Forest), and XGB (eXtreme Gradient Boosting).

| | Words | Drain | Lenma | Spell | Bert | Average | |---------|--------|--------|--------|--------|--------|---------| | DT | 0.9719 | 0.9816 | 0.9803 | 0.9828 | 0.9301 | 0.9693 | | SVM | 0.9568 | 0.9591 | 0.9605 | 0.9559 | 0.8569 | 0.9378 | | LR | 0.9476 | 0.8879 | 0.8900 | 0.9233 | 0.5841 | 0.8466 | | RF | 0.9717 | 0.9749 | 0.9668 | 0.9809 | 0.9382 | 0.9665 | | XGB | 0.9721 | 0.9482 | 0.9492 | 0.9535 | 0.9408 | 0.9528 | |---------|--------|--------|--------|--------|--------|---------| | Average | 0.9640 | 0.9503 | 0.9494 | 0.9593 | 0.8500 | |

Functional overview

LogLead is composed of distinct modules: the Loader, Enhancer, and Anomaly Detector. We use Polars dataframes as its notably faster than Pandas.

Loader: This module reads in the log files and deals with the specifics features of each log file. It produces a dataframe with certain semi-mandatory fields. These fields enable actions in the subsequent stages. LogLead has a raw loader that can load any log file. It also has custom loaders to the following public datasets from 10 different systems. Custom loaders should result in more accurate anomaly detection: * 3: HDFS_v1, Hadoop, BGL thanks to amazing LogHub team. For full data see Zenodo. * 3: Sprit, Thunderbird and Liberty can be found from Usenix site.
* 2: Nezha has data from two systems TrainTicket and Google Cloud Webshop demo. It is the first dataset of microservice-based systems. Like other traditional log datasets it has Log data but additionally there are Traces and Metrics. * 2: ADFA and AWSCTD are two datasets designed for intrusion detection.

Enhancer: This module extracts additional data from logs. The enhancement takes place directly within the dataframes, where new columns are added as a result of the enhancement process. For example, log parsing, the creation of tokens from log messages, and measuring log sequence lengths are all considered forms of log enhancement. Enhancement can happen at the event level or be aggregated to the sequence level. Some of the enhancers available: Event Length (chracters, words, lines), Sequence Length, Sequence Duration, following "NLP" enhancers: Regex, Words, Character n-grams. Log parsers: Drain, LenMa, Spell, IPLoM, AEL, Brain, Fast-IPLoM, Tipping, and BERT. NextEventPrediction including its probablities and perplexity. Next event prediction can be computed on top of any of the parser output.

Anomaly Detector: This module uses the enhanced log data to perform Anomaly Detection. It is mainly using SKlearn at the moment but there are few customer algorithms as well. LogLead has been integrated and tested with following models: * Supervised (5): Decision Tree, Support Vector Machine, Logistic Regression, Random Forest, eXtreme Gradient Boosting * Unsupervised (4): One-class SVM, Local Outlier Factor, Isolation Forest, K-Means * Custom Unsupervised (2): Out-of-Vocabulary Detector counts amount words or character n-grams that are novel in test set. Rarity Model, scores seen words or character n-grams based on their rarity in training set. See our public preprint for more details

Owner

  • Name: EvoTestOps
  • Login: EvoTestOps
  • Kind: organization

https://github.com/evotestops/.github/tree/main/profile/README.md

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
- family-names: Mäntylä
  given-names: Mika
- family-names: Wang
  given-names: Yuqing
- family-names: Nyyssölä
  given-names: Jesse
- family-names: Bakhtin
  given-names: Alexander
message: "If you use this software, please cite it as below."
title: "LogLead"
version: "0.0.1" # Update this version as necessary
date-released: 2024-05-23 # Update the date together with version
url: "https://github.com/EvoTestOps/LogLead"

preferred-citation:
  type: conference-paper
  authors:
    - family-names: Mäntylä
      given-names: Mika
    - family-names: Wang
      given-names: Yuqing
    - family-names: Nyyssölä
      given-names: Jesse
  title: "LogLead - Fast and Integrated Log Loader, Enhancer, and Anomaly Detector"
  booktitle: "Proceedings of the IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)"
  year: 2024
  publisher: IEEE
  address: Rovaniemi, Finland
  pages: "1-5"
  url: "https://arxiv.org/abs/2311.11809"

GitHub Events

Total
  • Create event: 5
  • Issues event: 2
  • Release event: 3
  • Watch event: 10
  • Delete event: 3
  • Push event: 9
Last Year
  • Create event: 5
  • Issues event: 2
  • Release event: 3
  • Watch event: 10
  • Delete event: 3
  • Push event: 9

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 51 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: loglead

LogLead stands for Log Loader, Enhancer, and Anomaly Detector

  • Homepage: https://github.com/EvoTestOps/LogLead
  • Documentation: https://loglead.readthedocs.io/
  • License: MIT License Copyright (c) 2023 mmantyla Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 1.2.1
    published about 1 year ago
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 51 Last month
Rankings
Dependent packages count: 10.3%
Average: 34.1%
Dependent repos count: 57.9%
Maintainers (1)
Last synced: 7 months ago

Dependencies

pyproject.toml pypi