Last active
August 29, 2015 13:59
-
-
Save brodul/10983822 to your computer and use it in GitHub Desktop.
ossec check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, time | |
root_log_dir = "/opt/ossec/logs/alerts" | |
months = [ | |
(1, 'January'), | |
(2, 'February'), | |
(3, 'March'), | |
(4, 'April'), | |
(5, 'May'), | |
(6, 'June'), | |
(7, 'July'), | |
(8, 'August'), | |
(9, 'September'), | |
(10, 'October'), | |
(11, 'November'), | |
(12, 'December') | |
] | |
years = [int(year) for year in os.listdir(root_log_dir) if len(year) == 4] | |
latest_year = max(*years) | |
latest_dir = os.join(root_log_dir, latest_year) | |
days = [ (day, time.ctime(os.path.getctime(os.path(latest_dir, day))) )for day in os.listdir(latest_dir)] | |
import pdb; pdb.set_trace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment