Skip to content

Latest commit

 

History

History
12 lines (7 loc) · 1.37 KB

File metadata and controls

12 lines (7 loc) · 1.37 KB

Drain

Drain is one of the representative algorithms for log parsing. It can parse logs in a streaming and timely manner. To accelerate the parsing process, Drain uses a fixed depth parse tree (See the figure below), which encodes specially designed rules for parsing.

Sturcture of parse tree in Drain

Drain first preprocess logs according to user-defined domain knowledge, ie. regex. Second, Drain starts from the root node of the parse tree with the preprocessed log message. The 1-st layer nodes in the parse tree represent log groups whose log messages are of different log message lengths. Third, Drain traverses from a 1-st layer node to a leaf node. Drain selects the next internal node by the tokens in the beginning positions of the log message. Then Drain calculates similarity between log message and log event of each log group to decide whether to put the log message into existing log group. Finally, Drain updates the Parser Tree by scaning the tokens in the same position of the log message and the log event.

Read more information about Drain from the following paper: