一句话:通过多数据集实证揭示稀有日志模板的普遍性及其被主流解析评测指标掩盖的性能问题。
日志解析将非结构化日志转为结构化表示,是调试、监控、根因分析和异常检测的关键步骤。真实日志在模板层面呈长尾分布:少量高频模板主导数据,大量模板仅出现几次,常对应失败或异常事件。本文在多个真实日志数据集上开展实证研究,量化稀有模板(关联实例少于5个)的普遍性及其对评测的影响。结果显示,平均约12%的模板为稀有模板,却仅覆盖不足0.03%的日志消息;PA、GA等常用指标被高频模板主导,会掩盖稀有模板上的严重性能退化。采用模板级FTA/FGA后,可观察到整体高准确率与稀有关键模板表现差并存,表明评测需显式考虑模板频率。
Log parsing is a critical step in automated log analysis, enabling tasks such as debugging, monitoring, root cause analysis, and anomaly detection by transforming unstructured log messages into structured representations. Despite extensive research on log parsing, real-world log data exhibits a pronounced long-tail structure at the template level: a small number of frequent log templates dominate the data, while a large fraction of templates occur only a few times. These rare templates often correspond to failures, abnormal behaviors, or rare system events, yet they are severely underrepresented in commonly used benchmarks such as LogHub-2.0.In this paper, we conduct a comprehensive empirical study across multiple real-world log datasets to quantify the prevalence of rare log templates and to examine their impact on log parsing evaluation. Our analysis shows that, on average, approximately 12% of log templates are rare, while collectively accounting for less than 0.03% of log messages. In our research, rare log events defined as groups that having fewer than five associated log instances. We further demonstrate that commonly used evaluation metrics, such as Parsing Accuracy (PA) and Grouping Accuracy (GA), are dominated by frequent templates and can obscure substantial performance degradation on rare ones. Using template-level metrics, including F1_score of Template accuracy(FTA) and F1_score of grouping accuracy(FGA), we show that strong overall accuracy can coexist with poor performance on rare but operationally critical log templates. These findings highlight the need for evaluation protocols that explicitly account for template frequency when assessing log parsers in real-world settings.