discord
This commit is contained in:
@@ -19,13 +19,15 @@ from tqdm import tqdm
|
||||
# Configuration
|
||||
# =========================
|
||||
# DEFAULT_LM_IP = "192.168.1.221" # default LM Studio host (without /v1)
|
||||
DEFAULT_LM_IP = "10.81.209.99" # default LM Studio host (without /v1)
|
||||
# DEFAULT_LM_IP = "10.81.209.99" # default LM Studio host (without /v1)
|
||||
DEFAULT_LM_IP = "100.113.108.121" # default LM Studio host (without /v1)
|
||||
LLM_MODEL = "openai/gpt-oss-20b"
|
||||
LLM_API_KEY = "not-needed" # LM Studio typically doesn't require an API key
|
||||
|
||||
INPUT_CSV = "test.csv"
|
||||
OUTPUT_CSV = "test_with_names.csv"
|
||||
EVENT_LOG = "event_log.txt"
|
||||
EVENT_LOG_MD = "event_log.md" # markdown version for easier reading
|
||||
FINAL_SNAPSHOT = "final.csv" # snapshot right before LM Studio summarization
|
||||
|
||||
# Columns to process
|
||||
@@ -355,5 +357,19 @@ if not df.empty:
|
||||
|
||||
total_events = sum(len(v) for v in grouped_summaries.values())
|
||||
print(f"📝 Overwrote {EVENT_LOG} with {total_events} grouped event summaries")
|
||||
|
||||
# Write markdown version for easier reading
|
||||
with open(EVENT_LOG_MD, "w", encoding="utf-8") as f:
|
||||
f.write("# Security Admin Audit Event Log\n\n")
|
||||
for user in sorted(grouped_summaries.keys()):
|
||||
f.write(f"## {user}\n\n")
|
||||
f.write("| Date | Event Summary |\n")
|
||||
f.write("|------|---------------|\n")
|
||||
for mmdd, line in grouped_summaries[user]:
|
||||
date_str = mmdd if mmdd else "N/A"
|
||||
escaped_line = line.replace("|", "\\|")
|
||||
f.write(f"| {date_str} | {escaped_line} |\n")
|
||||
f.write("\n")
|
||||
print(f"📝 Wrote {EVENT_LOG_MD} with {total_events} grouped event summaries (markdown)")
|
||||
else:
|
||||
print("ℹ️ No matching rows found; nothing to summarize.")
|
||||
|
||||
Reference in New Issue
Block a user