Skip to content

Commit 0f3be11

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

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructure.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1404,10 +1404,16 @@ 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(
1411+
url_with_port, "services/collector/event"
1412+
)
14071413
res = requests.post(
14081414
url_with_hec_path,
14091415
params=url_params,
1410-
data=datafile.read(),
1416+
data=content,
14111417
allow_redirects=True,
14121418
headers=headers,
14131419
verify=verify_ssl,

0 commit comments

Comments
 (0)