Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove start_datetime and end_datetime as required args, fix bug limiting amount of searches to 10k events #959

Merged
merged 4 commits into from
Jan 21, 2025
Merged
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
9 changes: 5 additions & 4 deletions dftimewolf/lib/collectors/timesketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ def SetUp(
else:
self.sketch_id = int(sketch_id)

if not start_datetime or not end_datetime:
self.ModuleError(
'Both the start and end datetime must be set.', critical=True)

if output_format not in _VALID_OUTPUT_FORMATS:
self.ModuleError(
f'Output format not one of {",".join(_VALID_OUTPUT_FORMATS)}',
Expand Down Expand Up @@ -217,6 +213,11 @@ def _GetSearchResults(self) -> pd.DataFrame:
else:
label_chip.label = label
search_obj.add_chip(label_chip)

# Timesketch API returns a max of 10000 results by default
if search_obj.expected_size > 10000:
search_obj.max_entries = search_obj.expected_size + 1

return search_obj.to_pandas()

def _OutputSearchResults(self, data_frame: pd.DataFrame) -> None:
Expand Down
Loading