data-prepper icon indicating copy to clipboard operation
data-prepper copied to clipboard

Stop listing indexes after one time pull from the OpenSearch indices

Open graytaylor0 opened this issue 9 months ago • 0 comments

Is your feature request related to a problem? Please describe. As a user of the OpenSearch source, I would like to only do a one-time list of the indices rather than periodically pull new indices.

Describe the solution you'd like An option in the OpenSearch source to configure the number of cat/indices calls to make.

source:
  opensearch:
    scheduling:
       list_index_count: 1

Would only list indexes once, process those indexes, and then stop listing and working completely.

This can be done in a similar way as the S3 Source, which will only has a configurable scan count that will block subsequent scans once that scan count is reached (https://github.com/opensearch-project/data-prepper/blob/2f9bed8ae28868c33f50e7e929b502970cb23aff/data-prepper-plugins/s3-source/src/main/java/org/opensearch/dataprepper/plugins/source/s3/S3ScanPartitionCreationSupplier.java#L73). This would be applied to the Global state item and supplier for the OpenSearch source (https://github.com/opensearch-project/data-prepper/blob/2f9bed8ae28868c33f50e7e929b502970cb23aff/data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/source/opensearch/worker/OpenSearchIndexPartitionCreationSupplier.java#L65)

Describe alternatives you've considered (Optional) A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

graytaylor0 avatar Apr 26 '24 20:04 graytaylor0