Skip to content

Commit

Permalink
add timeline_ids for specifying timelines for analyzers to run on
Browse files Browse the repository at this point in the history
  • Loading branch information
YiChiCanCode committed Aug 27, 2024
1 parent 70470ed commit 4db3112
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions importer_client/python/timesketch_import_client/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,8 @@ def celery_task_id(self):
"""Return the celery task identification for the upload."""
return self._celery_task_id

def close(self, analyzer_names=None):
"""Close the streamer, and run the analyzers based on the analyzer_names"""
def close(self, analyzer_names=None, timeline_ids=None):
"""Close the streamer, run the specified analyzers on the specified timeline ids"""
try:
self._ready()
except ValueError:
Expand All @@ -724,10 +724,15 @@ def close(self, analyzer_names=None):
)

data = (
{"index_name": self._index, "analyzer_names": analyzer_names}
if analyzer_names is not None
{
"index_name": self._index,
"analyzer_names": analyzer_names,
"timeline_ids": timeline_ids,
}
if (analyzer_names is not None) and (timeline_ids is not None)
else {"index_name": self._index}
)

_ = self._sketch.api.session.post(pipe_resource, json=data)

def flush(self, end_stream=True):
Expand Down

0 comments on commit 4db3112

Please sign in to comment.