Skip to content

Tutorial

Marc-Olivier Buob edited this page Jun 13, 2022 · 14 revisions

Basic usage

  1. Load the text file (/var/log/Xorg.0.log in this example):
FILENAME = "/var/log/Xorg.0.log" # Or any arbitrary log file
with open(FILENAME) as f:
    XORG_LINES = [line.strip() for line in f.readlines()]
  1. Compute the pattern-based clustering. Note you could tune parameters to customize the patterns considered by the pattern-based distance and the threshold used by the clustering algorithm. The async specifies whether the clustering must be parallelized or not.
from pattern_clustering import pattern_clustering

map_row_cluster = pattern_clustering(XORG_LINES, async=True)
pprint(map_row_cluster)
Clone this wiki locally