Listing all files in S3 everytime new file is added

Hi,

We are using logstash to read logs from S3, we have millions of files in S3 bucket for Cloudtrail logs. When a new file is added, logstash is listing all files first and then reading the logs from new file, its taking very long time to list all files as there are many. is there any solution for this issue?