Skip to content

Commit d7b8e9f

Browse files
Merge pull request #119 from google/all-type-log-export-update
update create data export for all log types
2 parents 08f4655 + 47efad0 commit d7b8e9f

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.19.1] - 2025-09-19
9+
### Fixed
10+
- Create data export for all log types flag
11+
812
## [0.19.0] - 2025-09-18
913
### Added
1014
- Support for export native dashboard method

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "secops"
7-
version = "0.19.0"
7+
version = "0.19.1"
88
description = "Python SDK for wrapping the Google SecOps API for common use cases"
99
readme = "README.md"
1010
requires-python = ">=3.7"

src/secops/chronicle/data_export.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,15 @@ def create_data_export(
199199

200200
# Add export_all_logs if True
201201
if export_all_logs:
202-
payload["export_all_logs"] = True
202+
# Setting log type as ALL TYPES for all log export
203+
payload["log_type"] = (
204+
f"projects/{client.project_id}/"
205+
f"locations/{client.region}/instances/"
206+
f"{client.customer_id}/logTypes/ALL_TYPES"
207+
)
208+
# export_all_logs parameter is currently not valid
209+
# TODO: Revert back to export_all_logs once parameter works
210+
# payload["export_all_logs"] = True
203211

204212
# Construct the URL and send the request
205213
url = f"{client.base_url}/{client.instance_id}/dataExports"

tests/chronicle/test_data_export.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,8 @@ def test_create_data_export_with_all_logs(chronicle_client):
173173

174174
# Check that the request payload included export_all_logs
175175
mock_post.assert_called_once()
176-
args, kwargs = mock_post.call_args
177-
assert kwargs["json"]["export_all_logs"] is True
178-
assert "log_type" not in kwargs["json"]
176+
_, kwargs = mock_post.call_args
177+
assert "ALL_TYPES" in kwargs["json"]["log_type"]
179178

180179

181180
def test_cancel_data_export(chronicle_client):

0 commit comments

Comments
 (0)