How to generate index files after /flush

I’m exporting logs using the Loki migrate tool. However, I cannot export the most recent logs, as the ingester holds them in memory (about 20 minutes of logs), and the migrate tool only considers chunks already stored on the filesystem. I tried flushing the in-memory chunks (POST /flush) before running the export, but while this flushes the chunks, it doesn’t generate index files for them. As a result, the migrate tool ignores these chunks because there are no corresponding index files.

Is there a way to force the generation of index files for these flushed chunks? Or do you have any suggestions on how I can achieve my requirement using the Loki migrate tool?

I haven’t had to use the migrate tool before, but I would recommend you to stop traffic on your cluster and flush before running the migration.

Also, I am pretty sure index files do get created when flushing.