Skip to content

Commit 1f21143

Browse files
chore: ADDON-77801 Added support for ingesting json event using contentctl
1 parent a64d879 commit 1f21143

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructure.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,14 @@ def hec_raw_replay(
14041404
)
14051405
with open(tempfile, "rb") as datafile:
14061406
try:
1407+
content = datafile.read()
1408+
content_str = content.decode("utf-8")
1409+
if content_str.startswith('{"event"'):
1410+
url_with_hec_path = urllib.parse.urljoin(url_with_port, "services/collector/event")
14071411
res = requests.post(
14081412
url_with_hec_path,
14091413
params=url_params,
1410-
data=datafile.read(),
1414+
data=content,
14111415
allow_redirects=True,
14121416
headers=headers,
14131417
verify=verify_ssl,

0 commit comments

Comments
 (0)