Log Anomaly Detection & Alert Triage

OTU MITS · Group 6 · OWASP A09:2025

Contextual log anomaly detection and alert triage

One pipeline from raw system logs to ranked, explained security alerts, evaluated under a protocol fixed before the experiments: chronological splits, deduplicated test sets, three seeds and paired 95% bootstrap intervals.

Aditya Varma Dantuluri · Chinonso Hillary Ugwuanyi · Philip Owusu-Afriyie

  1. 1
    ParseRaw log lines to event templates: Drain, digit mask or a local LLMRQ2
  2. 2
    DetectScore sessions with DeepLog, LogRobust or a parser-free transformerRQ1
  3. 3
    TriageRank Sysmon events for an analyst and explain each one with the LLMRQ3

Architecture

How the pipeline and the models fit together

Two paths lead to a session score: parsed event sequences for DeepLog and LogRobust, or raw messages through frozen BERT for the transformer. Triage ranks Windows Sysmon events with the local LLM, a text detector, or both, and cuts each ranking at a threshold fixed on validation.

System architecture
DETECTION · RQ1 AND RQ2 Raw log lines HDFS, BGL (Loghub) Parse to templates Drain · digit mask · LLM Event sequences one per session DeepLog LogRobust Drop digit tokens no parser, fixed rule Frozen BERT 768 numbers per line Transformer 2 encoder layers P(anomaly) per session Evaluate threshold on valbootstrap CIs lines messages TRIAGE · RQ3 Sysmon events ATLASv2 process starts Local LLM Qwen3-4B, JSON answer Text detector char n-grams + logistic reg. Rankings LLM · detector · both Cutoff set on val keeps 95% of val attacks Review queue ranked + explained Analyst dashboard fields shown severity P(attack) on test

Coloured edges mark the models compared in RQ1 and the triage scorers in RQ3. Each stage is its own notebook that saves its outputs, so any stage can be rerun alone.

DeepLog
Last 10 event IDs sliding window, h = 10 Embedding 32 numbers per event LSTM, 2 layers 64 hidden units Softmax over event types probability of each next event Next event in the top g? no: flag session (g starts at 9)

Semi-supervised: trained on normal sessions only.

LogRobust
Session of templates event IDs from the parser Template vectors FastText 300-d, TF-IDF weighted Bi-LSTM, 2 layers 128 units each direction Attention pooling one weight per event P(anomaly) linear layer, 2 classes

Supervised: trained on normal and anomalous sessions.

Transformer
Raw lines of a session digit tokens dropped Frozen BERT bert-base-uncased, 768-d Projection + positions 128-d, sinusoidal Encoder, 2 layers 4 heads, pre-norm Attention pooling then P(anomaly)

Supervised, parser-free, in the style of NeuralLog.

LLM triage
Sysmon process start process, command line, parent, user Qwen3-4B, local greedy decoding JSON answer severity 0-100, explanation, evidence Answer checks retry once; evidence must be in event Severity ranking cutoff set on validation

No training: one prompt per event, answers cached.

RQ1 · Detection

Does a transformer beat DeepLog and LogRobust?

Yes. The parser-free transformer is clearly best on both datasets on F1, AUPRC and false alarms. Dots are seed means; bars are 95% bootstrap intervals on the deduplicated test set.

Paired differences: transformer minus each baseline, same test items

A difference counts only when its 95% interval excludes zero. For false alarms, below zero is better.

Table: detection on the deduplicated test sets
Table: paired differences

RQ2 · Parsing

Does LLM parsing beat Drain?

On grouping, yes. On detection, no. The local LLM groups 11.2M HDFS lines almost perfectly, but simple digit masking gets most of the way, and better templates did not produce better detectors.

Grouping accuracy, all 11.2M HDFS lines

Axis starts at 0.80.

Downstream F1 by parser

Seed mean ± one standard deviation.

Table: grouping accuracy on all HDFS lines
Table: downstream detection by parser
Table: parsing accuracy on Loghub's 2,000-line samples

RQ3 · Triage

Can LLM triage cut workload while keeping 95% of attacks?

No, not under the pre-registered protocol. Cutoffs chosen on validation did not transfer to new attacks: detector rankings reviewed about 1% of items but caught about 55% of attacks, while the LLM alone kept every attack only by flagging everything.

Test recall against share of items reviewed, at each ranking's validation cutoff

2,160 test items, 38 attacks (hand-checked labels). The shaded zone is the goal: at least 95% recall with less than the full workload. LLM and severity rule sit on the same point: they review everything.

0.74%

LLM answers unparseable after one retry (target under 1%)

1.35%

Answers citing evidence not in the event (hallucination)

Explanation ratings, 1 to 5

Two blind passes by an LLM judge, not human raters (protocol D10).

In hindsight: share of test items each ranking needed to reach 95% recall

Read from the test curve after the fact, so it is descriptive only and never a usable cutoff. It shows the detector ranking does order attacks well (8% of items for 95% recall); the cutoff picked on validation was what failed to transfer.

Table: triage results by ranking
Table: workload needed on the test curve

Robustness · RQ1 and RQ2

What happens when log lines change?

LogRobust holds up best; DeepLog collapses on HDFS. 5, 10 and 20% of test lines were altered (insertions, deletions, replacements, swaps) and every saved model re-scored with its clean-validation settings.

F1 drop = altered minus clean. Bands are paired 95% intervals. One draw of alterations (seed 0).

Table: F1 drop by detector, parser and altered share

Data and status

What was measured, and on what

Every planned measure was run, except one that was dropped and one that was replaced; both are recorded as deviations in the protocol.

Planned measures

    ATLASv2 triage data (RQ3)

    Attack labels were hand-checked; "original" counts the dataset's own labels.

    Method

    How the numbers were produced

    Chronological splits

    Earliest 70% trains, next 10% validates, latest 20% tests. Test sessions that repeat a training sequence are removed for the primary results.

    Settings on validation only

    Each detector starts at its published default (DeepLog g = 9, P(anomaly) ≥ 0.5); validation may only make it stricter.

    Honest uncertainty

    Three seeds, 1,000 stratified bootstrap resamples. One model "beats" another only when the paired interval excludes zero.

    Detectors

    DeepLog (LSTM, semi-supervised), LogRobust (attention Bi-LSTM on FastText + TF-IDF vectors) and a NeuralLog-style transformer on frozen BERT vectors.

    Local LLM

    Qwen3-4B-Instruct-2507 run inside Colab with greedy decoding and cached answers, for both parsing and triage.

    Data

    Loghub HDFS_v1 (575k sessions) and BGL (47k windows); ATLASv2 Windows Sysmon process starts (65k items) for triage.

    Limitations

    • Small validation splits that are not representative of the test periods.
    • 38 test attacks on ATLASv2, so one attack is about 2.6 points of recall.
    • Synthetic alterations in the robustness test, not real software updates.
    • One 4B-parameter LLM for all parsing and triage results.
    • Explanation ratings by an LLM judge rather than human analysts.