Convert Linux logs to OCSF schema
Project description
logs_to_ocsf
This file will become your README and also the index of your documentation.
Install
pip install logs_to_ocsf
How to use
Add sample data and run.
from logs_to_ocsf.convert_messages import *
c = Convert()
test_dir = "data/sample_logs"
test_files = ["messages.txt", "cron.txt", "secure.txt"]
for a_file in test_files:
a_json = c.log_to_ocsf(test_dir + "/" + a_file)
print(f"\nJSON in OCSF Schema from file {a_file} has this many records:")
print("-----------------------------------------------------------")
print(len(a_json))
print("-----------------------------------------------------------")
JSON in OCSF Schema from file messages.txt has this many records:
-----------------------------------------------------------
37
-----------------------------------------------------------
JSON in OCSF Schema from file cron.txt has this many records:
-----------------------------------------------------------
40
-----------------------------------------------------------
JSON in OCSF Schema from file secure.txt has this many records:
-----------------------------------------------------------
40
-----------------------------------------------------------
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
logs_to_ocsf-0.0.5.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for logs_to_ocsf-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae4d473e334cf764974f6a725706d9ce6b9daaf4eef7937cbb17bed5edb77da2 |
|
MD5 | ba3122328ec4899b2990c592fb96b00a |
|
BLAKE2b-256 | ad534f421806fd09f5166e3f11f381566d968f3a10596a0534cef9d0d1b81fcf |