This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use regex::Regex; | |
use std::collections::HashMap; | |
use std::fs; | |
fn main() { | |
let content = read(); | |
let re = Regex::new(r#"^(?P<ip>\S+) \S+ \S+ \[(?P<timestamp>[^\]]+)\] "(?P<method>\S+) (?P<path>[^\s]+) \S+" (?P<status>\d+) \d+ "(?P<referrer>[^"]*)" "(?P<user_agent>[^"]*)"$"#).unwrap(); | |
let mut mac = HashMap::new(); | |
let mut linux = HashMap::new(); | |
let mut win = HashMap::new(); |