4个版本
0.1.4 | 2022年6月17日 |
---|---|
0.1.3 | 2022年2月21日 |
0.1.2 | 2022年2月20日 |
0.1.1 | 2022年2月20日 |
#2254 在 解析器实现
21KB
459 行
CEF到HashMap
将syslog CEF字符串或普通CEF字符串转换为HashMap对象。
要求
- Rust 1.56+ (2021版本)
示例用法
[dependencies]
cef2hashmap = "0.1.3"
然后
use cef2hashmap::CefToHashMap;
fn main() {
let example = "<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 target=Admin msg=User signed in from 127.0.0.1 Tenant=Primary TenantId=0 act= cs1Label=Testing Label 1 Key cs1=Testing Label 1 String Value";
println!("{:#?}", example.to_hashmap(true));
}
- 将
false
传递给.to_hashmap(false)
,如果您不想保留原始事件
许可:MIT