google / timesketch

Collaborative forensic timeline analysis
Apache License 2.0
2.61k stars 589 forks source link

Filter on field when generating timeline from index #2356

Closed Zawadidone closed 8 months ago

Zawadidone commented 2 years ago

Describe the solution you'd like When using the function generate_timeline_from_es_index I would like to add an argument based on a single key value pair. https://github.com/google/timesketch/blob/40afb16415dc6ff67791472e56b13f0a0fef894c/api_client/python/timesketch_api_client/sketch.py#L1657 https://timesketch.org/developers/api-upload-data/#import-data-already-ingested-into-opensearch

This values can be used in the Query DSL to filter documents based on the key value pair. For example ID=1. https://github.com/google/timesketch/blob/b7c7f428069a19564ceea7f31a2e19047848e855/timesketch/api/v1/resources/event.py#L1000

This adds the following features to Timesketch when adding dat already ingested in to Opensearch:

Describe alternatives you've considered Using a single index for a single timeline which is not compatible with 1500+ timelines. https://timesketch.org/guides/admin/scaling-and-limits/#opensearch-indices-limitation

Zawadidone commented 8 months ago

Implemented in https://github.com/hnhdev/timesketch/commit/7541f04ea4bc747737a6feec1d39ef3df3e878e0 and https://github.com/hnhdev/timesketch/commit/3be98d2e9b1b107b3e376e45a6677129b3abe176.