There are about 800000 log files in my environment, and now logstash is stuck after starting. Is there any solution? You can collect the latest files

There are about 800000 log files in my environment, and now logstash is stuck after starting. Is there any solution? You can collect the latest files