Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marirs/leef2hashmap-rs
A Simple LEEF Parser to a HashMap
https://github.com/marirs/leef2hashmap-rs
ibm ibm-leef leef parser rust rust-crate rust-lang rust-language rust-library
Last synced: about 2 months ago
JSON representation
A Simple LEEF Parser to a HashMap
- Host: GitHub
- URL: https://github.com/marirs/leef2hashmap-rs
- Owner: marirs
- License: mit
- Created: 2022-05-06T02:27:57.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-06-17T05:09:07.000Z (over 2 years ago)
- Last Synced: 2024-10-19T18:18:36.482Z (3 months ago)
- Topics: ibm, ibm-leef, leef, parser, rust, rust-crate, rust-lang, rust-language, rust-library
- Language: Rust
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LEEF to HashMap
[![Linux Arm7](https://github.com/marirs/cef2hashmap-rs/actions/workflows/linux_arm.yml/badge.svg)](https://github.com/marirs/cef2hashmap-rs/actions/workflows/linux_arm.yml)
[![Linux x86_64](https://github.com/marirs/cef2hashmap-rs/actions/workflows/linux_x86_64.yml/badge.svg)](https://github.com/marirs/cef2hashmap-rs/actions/workflows/linux_x86_64.yml)
[![macOS](https://github.com/marirs/cef2hashmap-rs/actions/workflows/macos.yml/badge.svg)](https://github.com/marirs/cef2hashmap-rs/actions/workflows/macos.yml)
[![Windows](https://github.com/marirs/cef2hashmap-rs/actions/workflows/windows.yml/badge.svg)](https://github.com/marirs/cef2hashmap-rs/actions/workflows/windows.yml)Convert a syslog LEEF string or a regular LEEF string to a HashMap object.
### Requirements
- Rust 1.56+ (2021 edition)### Example Usage
```toml
[dependencies]
leef2hashmap = "0.1.3"
```and then
```rust
use leef2hashmap::LeefToHashMap;fn main() {
let example = "<134>2022-02-14T03:17:30-08:00 2001:db8:3333:4444:5555:6666:7777:8888 Jan 18 11:07:53 198.76.5.4 LEEF:1.0|VMware Carbon_Black|App Control|8.6.0.155|NEW_PORT_DISCOVERD||src=172.5.6.67dst=172.50.123.1sev=5cat=anomalymsg=there are spaces in this message";
println!("{:#?}", example.to_hashmap(true));
}
```
- pass `false` to `.to_hashmap(false)` if you don't want to preserve the original event---
License: MIT