Filebeat doesn't clear the registry file after logrotation

You are right the correct path is /root/demo01.log* or even /root/demo01.*. Can you share some log files please on at least the info level? This should make it clear why files are not removed. The registry is cleared every time new data is added.

I think the config you are looking for is clean_inactive.

You can also set ignore_older to a much larger value, but is must be smaller then clean_inactive as otherwise the two will get into a race condition.

In your case I would think that setting ignore_older to 24 hours should work and clean_inactive to 36 hours for example as you seem to have daily logs.