Multi-pattern Match

v0.1.0Added Sep 26, 2026Sample data

Aho–Corasick matching of thousands of patterns in one pass, for scanning logs and payloads for indicators of compromise.

Sample data. These figures are placeholders, not measurements.

cargo install kura-rs
kura add multi-pattern-match

Copies the source file into your project. You own the code from then on.

If another tool already installs a kura command, run cargo install kura-rs --bin kura-rs and use kura-rs add instead.

use crate::parts::multi_pattern_match::Matcher;

let matcher = Matcher::new(&iocs);

for hit in matcher.find_all(&payload) {
    alert(hit.pattern, hit.offset);
}

Verification

Sample data

Checked against pyahocorasick 2.1.0 (Python) using differential testing: the same inputs go to both implementations and the outputs are compared.

Reference
pyahocorasick
Python 2.1.0
Test cases
3,000
Differential testing
Passed
2,997 / 3,000
3 mismatched
Last run
Sep 26, 2026
UTC

These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.

Benchmarks

Sample data

kura-rs (Rust) against pyahocorasick across input sizes. Faster at every measured input size, up to 5.0× faster.

These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.

kura-rs (Rust)pyahocorasick
Wall time per run (lower is better).
Show data table
Input sizekura-rs (Rust)pyahocorasickSpeedup
1,0000.02 ms0.05 ms2.5×
10,0000.14 ms0.52 ms3.7×
100,0001.3 ms5.8 ms4.5×
1,000,00013 ms61 ms4.7×
10,000,000128 ms640 ms5.0×

Files

  • parts/multi_pattern_match/mod.rs

Crate dependencies