Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Backend/event_generators/shared/hec_sender.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""Send logs from vendor_product generators to SentinelOne AI SIEM (Splunk‑HEC) one‑by‑one."""
import argparse, json, os, time, random, requests, importlib, sys
import argparse, json, os, time, random, requests, importlib, sys, uuid
import gzip, io, threading, queue
from datetime import datetime
from typing import Callable, Tuple, Optional
Expand Down Expand Up @@ -794,7 +794,11 @@ def _send_batch(lines: list, is_json: bool, product: str):
# Use fast compression (level 1) for high throughput - trades compression ratio for speed
# Level 1 is ~10x faster than default level 9, with only ~10% larger output
gz = gzip.compress(body, compresslevel=1)
headers = {**headers_auth, "Content-Type": "text/plain", "Content-Encoding": "gzip"}
# Add headers based on endpoint type
if is_json:
headers = {**headers_auth, "Content-Type": "text/plain", "Content-Encoding": "gzip"}
else:
headers = {**headers_auth, "Content-Type": "text/plain", "Content-Encoding": "gzip", "X-Splunk-Request-Channel": str(uuid.uuid4())}

if is_json:
# JSON products to /event endpoint
Expand Down
Loading