Refer to documentation below, it stated that:
You may encounter the following errors if your config file fails these checks:
Exiting: error loading config file: config file ("{beatname}.yml") must be owned by the beat user (uid=501) or rootTo correct this problem you can use either
chown root {beatname}.ymlorchown 501 {beatname}.ymlto change the owner of the configuration file.