Skip to content
Snippets Groups Projects
Commit 6aaf532a authored by Sebastien Boutelier's avatar Sebastien Boutelier
Browse files

Correction des regexp. Les dates entre 1 et 9 ont une espace devant...

parent eaed35cd
No related branches found
No related tags found
No related merge requests found
......@@ -196,12 +196,12 @@ fn main() {
let port = getport().unwrap();
let hostname = Some(gethostname().into_string().unwrap());
let _ = HOSTNAME.set(hostname);
let _ = REGEXP_LAUNCH.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ (?<con>\S+) (?<op>\S+) (?<command>\S+)").unwrap());
let _ = REGEXP_OTHERLOG.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ (?<log>.+)").unwrap());
let _ = REGEXP_RESULT.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ conn=(?<con>[0-9]+) op=(?<op>[0-9]+)( SEARCH)? RESULT \S+ (?<err>\S+)( nentries=(?<nentries>[0-9]+))?").unwrap());
let _ = REGEXP_CMD.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ conn=(?<con>[0-9]+) op=(?<op>[0-9]+) (?<cmd>(ADD|DEL|BIND|CMP|MOD|PASSMOD|SRCH)) (?<v>[a-z]+)=(?<val1>\S+)( \S+ \S+)?( (attr|filter)=(?<val2>\S+))?").unwrap());
let _ = REGEXP_CONNECT.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ conn=(?<con>[0-9]+) \S+ ACCEPT from IP=(?<ip>[0-9.:]+):[0-9]+").unwrap());
let _ = REGEXP_CLOSE.set(Regex::new(r"^\S+ \S+ \S+ \S+ \S+ conn=(?<con>[0-9]+) \S+ (closed|ABANDON)").unwrap());
let _ = REGEXP_LAUNCH.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ (?<con>\S+) (?<op>\S+) (?<command>\S+)").unwrap());
let _ = REGEXP_OTHERLOG.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ (?<log>.+)").unwrap());
let _ = REGEXP_RESULT.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ conn=(?<con>[0-9]+) op=(?<op>[0-9]+)( SEARCH)? RESULT \S+ (?<err>\S+)( nentries=(?<nentries>[0-9]+))?").unwrap());
let _ = REGEXP_CMD.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ conn=(?<con>[0-9]+) op=(?<op>[0-9]+) (?<cmd>(ADD|DEL|BIND|CMP|MOD|PASSMOD|SRCH)) (?<v>[a-z]+)=(?<val1>\S+)( \S+ \S+)?( (attr|filter)=(?<val2>\S+))?").unwrap());
let _ = REGEXP_CONNECT.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ conn=(?<con>[0-9]+) \S+ ACCEPT from IP=(?<ip>[0-9.:]+):[0-9]+").unwrap());
let _ = REGEXP_CLOSE.set(Regex::new(r"^\S+ [0-9 ]{2} \S+ \S+ \S+ conn=(?<con>[0-9]+) \S+ (closed|ABANDON)").unwrap());
let s = format!("127.0.0.1:{}",port);
let listener = TcpListener::bind(s).unwrap();
for stream in listener.incoming() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment