pub trait CefToHashMap {
// Required method
fn to_hashmap(&self, preserve_orig: bool) -> Result<HashMap<String, String>>;
}
Expand description
A Simple CEF Parser to a Standardised HashMap
Required Methods§
Sourcefn to_hashmap(&self, preserve_orig: bool) -> Result<HashMap<String, String>>
fn to_hashmap(&self, preserve_orig: bool) -> Result<HashMap<String, String>>
Converts a CEF &str or String into a HashMap. Also accepts syslog strings.
§
Example CEF Strings:
- <134>2022-02-14T03:17:30-08:00 TEST CEF:0|Vendor|Product|20.0.560|600|User Signed In|3|src=127.0.0.1 suser=Admin
- <134>Feb 14 19:04:54 CEF:0|Vendor|Product|20.0.560|600|User Signed In|3|src=127.0.0.1
- CEF:0|Vendor|Product|20.0.560|600|User Signed In|3|src=127.0.0.1 suser=Admin
§
§Example Usage:
use cef2hashmap::CefToHashMap;
let cef_str = "CEF:0|Vendor|Product|20.0.560|600|User Signed In|3|src=127.0.0.1 suser=Admin";
assert!(cef_str.to_hashmap(true).is_ok())