https://github.com/logpai/lilac
LILAC: Log Parsing using LLMs with Adaptive Parsing Cache [FSE'24]
https://github.com/logpai/lilac
Last synced: about 1 year ago
JSON representation
LILAC: Log Parsing using LLMs with Adaptive Parsing Cache [FSE'24]
- Host: GitHub
- URL: https://github.com/logpai/lilac
- Owner: logpai
- Created: 2024-02-01T01:48:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-03T17:46:03.000Z (over 2 years ago)
- Last Synced: 2025-03-27T08:58:13.150Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 594 KB
- Stars: 42
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LILAC: Log Parsing using LLMs with Adaptive Parsing Cache
This is the replication package for [FSE24] ["LILAC: Log Parsing using LLMs with Adaptive Parsing Cache"](https://arxiv.org/abs/2310.01796).
In this paper, we propose LILAC, the first practical LLM-based log parsing framework.
LILAC consists of two main components: the ICL-enhanced Parser and the adaptive parsing cache.

The detailed parsing time can be found in [detailed parsing time for RQ4](figures/parsing_time.png).
If you find our paper benefit your research, please kindly cite our related paper:
- Zhihan Jiang, Jinyang Liu, Zhuangbin Chen, Yichen Li, Junjie Huang, Yintong Huo, Pinjia He, Jiazhen Gu, Michael R. Lyu. [LILAC: Log Parsing using LLMs with Adaptive Parsing Cache](https://arxiv.org/abs/2310.01796) FSE, 2024.
## Repository Organization
```
├── full_dataset/ # Please download and unzip full datasets into this directory
│ └── sampled_examples # Our saved sampled candidates
├── benchmark/
│ ├── evaluation/ # the evaluation code of LILAC
│ └── logparser/ # the implementation code of LILAC
├── result/
│ └── ...... # contains the saved evaluation files
├── sampling/ # the implementation of candidate sampling algorithms
│ ├── logppt_sampling.py # the sampling algorithm of LogPPT
│ └── LILAC_sampling.py # the sampling algorithm of LILAC
├── requirements.txt
├── openai_key.txt # the OpenAI api address and key
└── README.md
```
## Quick Start
### Datasets
Please first download the large-scale datasets for log parsing in LogPub from [Zenodo](https://zenodo.org/record/8275861) and unzip these datasets into the directory of `full_dataset`.
### Installation
1. Install ```python >= 3.8```
2. ```pip install -r requirements.txt```
### Execution
- Candidate Sampling (optional)
We have provided the saved sampled candidate logs for reproducing.
One can also delete the `full_dataset/sampled_examples` and execute the LILAC's sampling algorithm as follows:
```bash
cd sampling/
python LILAC_sampling.py
```
- Online Log Parsing
Please first add an OpenAI API key (`sk-xxxx`) into the second line of openai_key.txt.
We provide a one-click script to run LILAC for online log parsing.
```bash
./online_parsing.sh
```
One can also go to `benchmark/evaluation` and execute:
```bash
python LILAC_eval.py --shot [candidates] --example_size [demonstrations] --model [model]
```
The parsed results and evaluation results will be saved in the `result/` directory.
We have provided the saved evaluation metric files of LILAC with different settings in the directory of `result/`.