Is that your entire filebeat.yml because I just tested that and it was fine.
I even ran it ... it was fine. Is there anything else in the filebeat I suspect you still have some other settings in the filebeat.yml
What version?
I would not use a full path for this but otherwise it is fine.
path: /root/filebeat-8.5.1-linux-x86_64/modules.d/*.yml
Normal
path: ./modules.d/*.yml