grok
A Rust implementation of the popular Java & Ruby grok library which allows easy text and log file processing with composable patterns.
2.4.1
8.8M downloads/mo
#3351 most downloaded on crates.io
mmastrac/grok
What this package is like to depend on
Last release 5 months ago
19 Mar 2026
Release timing varies
gaps range from 8 days to 3.0 years
Nearly every release is documented
notes for 18 of 19 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
19 releases · first in 2017
1 release in the last 12 months
see the full history below
Release timeline
19 releases · Sep 2017 to Mar 2026Releases
latest 19-
2.4.119 Mar 2026Release notes
Open source →- Update EMAILLOCALPART (https://github.com/mmastrac/grok/issues/31, thanks @bruberg)
-
2.4.031 Jul 2025Release notes
Open source →- Fix a bug where pattern definition ranges were off-by-one.
- (breaking) Fix bug in UNIXPATH pattern where
.was included rather than\., causing the pattern to match any character.
-
2.3.331 Jul 2025 -
2.3.231 Jul 2025Nothing published for this version
-
2.3.106 Jul 2025Release notes
Open source →- Remove
display()call inbuild.rsthat would require MSRV 1.88. - Bump MSRV to 1.77 (it was previously 1.56 but was not tested).
- Remove
-
2.3.006 Jul 2025Release notes
Open source →- Add support for
extractin pattern definitions, allowing theextractin%{name:alias:extract}to be retrieved from the pattern. - Add
Pattern::pattern()toMatchesto get the pattern that was used to match thisMatchesinstance. - Reduced the scope of inline pattern definitions to the current pattern only (before 2.2.0 they were added globally, in 2.2.0 they were available to all nested patterns, and in 2.3.0 they are only available to the current pattern).
Grok::compile()is now&selfinstead of&mut self.Grok::with_default_patterns()now usesCowfor the built-in patterns and allocates significantly less perGrokinstance (as well as being much faster).- Built-in patterns are available individually for reference in the new
patternsmodule.
- Add support for
-
2.2.005 Jul 2025Release notes
Open source →- Rewrote the pattern parsing to avoid using regular expressions, making all regular expression engine features optional (though at least one is still required).
- Ensure correctness in capture names, even when using duplicate names
generated from pattern names. These were previously unspecified:
- (breaking) Duplicate pattern names result in matches with incrementing names in the format:
NAME,NAME[1],NAME[2], etc. - (breaking) Duplicate pattern names from aliases are now guaranteed to be "last one wins".
- (breaking) Duplicate pattern names result in matches with incrementing names in the format:
- (breaking)
Matches::len()was removed as it was previously reporting the pattern name count. UseMatches::iter().count()instead. - (breaking)
Matches::is_empty()was removed. UseMatches::iter().count() == 0instead. - (breaking) Inline pattern definitions are no longer added to the global pattern list.
-
2.1.029 May 2025Release notes
Open source →- Add support for
pcre2feature which is significantly faster thanonig. - Add support for
regexandfancy_regexfeatures which allow for pure Rust operation. - Some default patterns were updated from upstream sources for better compatibility across engines.
- Add support for
-
2.0.007 Jun 2022Release notes
Open source →- Minimum Rust version is
1.56, Rust Edition switched to 2021. - (breaking) Renamed
Grok::with_patterns()toGrok::with_default_patterns(). - (breaking) Renamed
Grok::insert_definitiontoGrok::add_patternto stop mixing "definition" with "pattern". - (breaking)
Matches::iter()is now only returning the matches and not also the other patters with an empty string as the value. - Added
IntoIterfor&Matchesfor more convenient match iteration (i.e. for loop). - Added
Pattern::capture_nameswhich returns the names the compiled pattern captures. - Updated
onigto6.3. masterbranch is now calledmain.
- Minimum Rust version is
-
1.2.012 Mar 2021Release notes
Open source →- Updated
onigto6.1. - Allow to inspect the default built patterns. Thanks @magodo!
- Use the non_exhaustive attribute on
Erroras suggested by clippy.
- Updated
-
1.1.030 Oct 2019Release notes
Open source →- Updated
onigto5.0. - Use
Regex::foreach_namesinstead ofRegex::capture_namesto work on 32 bit platforms. Thanks @a-rodin!
- Updated
-
1.0.131 Oct 2019Release notes
Open source →- Use
Regex::foreach_namesinstead ofRegex::capture_namesto work on 32 bit platforms. Thanks @a-rodin!
- Use
-
1.0.028 Mar 2019 -
0.5.019 Feb 2018Release notes
Open source →==========
This is the sixth release of grok, with the following changes:
- Update
onigto 3.1, which itself brings enhancements and
more flexibilit in how to compile and use it.
- Update
-
0.4.115 Nov 2017Release notes
Open source →==========
This is the fifth release of grok, which brings a bugfix:
- Fixed a bug where the named pattern on compilation is also
accessible from the iterator.
Release notes
Open source →- Fixed a bug where the named pattern on compilation is also accessible from the iterator.
- Fixed a bug where the named pattern on compilation is also
-
0.4.015 Nov 2017Release notes
Open source →==========
This is the fourth release of grok, which brings an enhancement and
makes sure we run on appveyor.- Allow to specify named patterns when compiling, without inserting
the definition beforehand.
Release notes
Open source →- Allow to specify named patterns when compiling, without inserting the definition beforehand.
- Allow to specify named patterns when compiling, without inserting
-
0.3.013 Sep 2017Release notes
Open source →==========
This is the third release of grok, which brings enhancement
and compatibility improvements.- Slight performance improvements.
regexhas been switched toonigso we have full compatibility with all the other grok patterns.- Added
Grok::with_patterns()which loads all the default patterns.Grok::defalt()also uses that now. iter()is available onMatcheswhich yields a(&str, &str)kv pair of match/result.
Release notes
Open source →regexhas been switched toonigso we have full compatibility with all the other grok patterns.- Added
Grok::with_patterns()which loads all the default patterns.Grok::defalt()also uses that now. iter()is available onMatcheswhich yields a(&str, &str)kv pair of match/result.
-
0.2.006 Sep 2017Release notes
Open source →==========
This is the second release of grok, mainly adding
more methods to the match API as well as removing
all unwraps, expects and panics from the code.- Instead of panicing, all methods that could return a Result<T, grok::Error>.
- Grok::new() has been renamed to Grok::empty() (or Grok::default())
- is_empty() is available in the Matches API to check if there are matches at all.
- len() is available in the Matches API to get the total number of matches.
Release notes
Open source →- Instead of panicing, all methods that could return a
Result<T, grok::Error>. Grok::new()has been renamed toGrok::empty()(orGrok::default())is_empty()is available in theMatchesAPI to check if there are matches at all.len()is available in theMatchesAPI to get the total number of matches.
-
0.1.005 Sep 2017Release notes
Open source →==========
This is the initial release of the
grokrust library. It features
basic support for custom pattern definitions, compiling into a pattern
and then matching on the pattern accordingly.This is a very early release, and while the API surface isn't huge
expect some breaking changes!