Expand description
Grok, regex, CEL and scrubbing on typed primitives. Up to 9 times faster than the stock Rust regex.
Grok and regex are how a pattern is written, not how it runs. Every
matcher and parser reports the MatcherTier it runs on, and the regex
engine runs only when no native route covers the pattern.
§Sync by default, tokio when you ask
grippo is sync. It takes &[u8] and &str, loads no files and opens no
sockets, so parsing, matching and scrubbing have no async form: call them
on each record wherever it is. Bytes meet I/O only in grippo::io (the
framing feature), where a stream is framed into records and records into
a stream. io::Scanner and io::Writer do that with no I/O at all, and
io::frames and io::write_frames run them over BufRead and Write.
The tokio feature adds io::tokio, with the same two helpers over
AsyncRead and AsyncWrite and the tokio-util codec under them. It never
changes a sync item, and nothing else in grippo needs it.
Modules§
- charset
charset - UTF-16 and legacy code pages read as UTF-8.
- compose
compose - Typed primitives composed into a parser, with no pattern text.
- convert
convert - Field text converted to a typed value: an integer, a float at single or double precision, a boolean or an IP address.
- cost
- What a primitive costs, beside the
MatcherTierit runs on. - decode
decode-base64ordecode-gzipordecode-hexordecode-rsyslogordecode-snappyordecode-textordecode-zlibordecode-zstd - Parsers that decode their input and hand on the bytes, so a chain reads
field("payload"):base64 > gzip > ndjson. - domain
domain - A host name split at its public suffix from the list psl compiles in: the suffix, the registrable domain one label above it, and the subdomain below that, each a span of the name as written.
- expr
expr - CEL filter expressions lowered to prefix, suffix, substring, exact and
number checks over a
crate::record::Record, with no interpreter. - field
parse - Field parsers for the common grok patterns.
- format
parse - Stock parsers for standard formats, each behind its own feature and each a
crate::parse::Parserto name in a chain. The ones with a literal in their signature are whatautodetects. - grok
parse-grok - Grok: a regex written with named sub-patterns.
- io
framing - Records framed in and out of a byte stream, with no I/O of grippo’s own.
- json
json-depth - A depth guard for untrusted JSON.
- number
parseorrecord - A number’s text read as a value, by one of two stated readings.
- parse
parse - One
Parsertrait for every format, and a driver that runs a chain of them:syslog > cef > field("msg"):xml. - path
json-pathsorparseorscruborxml - Field paths, and the field names grippo’s parsers write in the same grammar.
- record
record - A record read by field path, whatever holds it: raw JSON bytes, a raw text
line, the fields a parser chain wrote, or raw XML bytes with
xml. - scrub
scrub - Secret detection and redaction with gitleaks’ rules and gitleaks’ answers.
- strmatch
strmatch - Regex patterns, run on the cheapest engine that gives the same answer.
- time
time - Turn a matched timestamp into an instant, and write an instant out.
- ua
ua - User agent strings read with a uap-core style rule table: the first rule whose regex matches names the browser, the operating system or the device, and its replacement fields fill in the answer.
- uri
uri - URI references split into borrowed parts.
- windows
windows - A Windows command line split into arguments as the Microsoft C runtime reads it, each argument a span of the line.
- xml
xml - XML to JSON records, mechanically: one input always gives the same output, with no per-source branches.
Enums§
- Dialect
- The regex language a pattern is written in. Rust’s regex syntax is the default.
- Matcher
Tier - The engine class a matcher or parser runs on.