#cef #events #json #hash-map #parser #syslog #string

cef2hashmap

一个简单的CEF解析器到HashMap

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

macOS Linux Arm7 Linux x86_64 Windows

将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

无运行时依赖