add_pattern/
add_pattern.rs1use grok_rs::Grok;
2
3fn main() {
4 let mut grok = Grok::default();
5 grok.add_pattern("NAME", r"[A-z0-9._-]+");
6 let pattern = grok.compile("%{NAME}", false).unwrap();
7 let result = pattern.parse("admin").unwrap();
8 println!("{:#?}", result);
9}