Filebeat config - USER system env variable

Hello, i am trying read logs from currently logged user folder. In filebeat config i have:
- /home/${USERNAME}/logs/foo.log, this does not even compile. But it work when i hardcode name like this:
- /home/${USERNAME:foo}/logs/foo.log, but i need this path to be dynamically allocated.

There are no logs in /var/log/filebeat/filebeat.log

Hi Johny,

Welcome to the discuss forum.
Now if you give out the environment variables on a linux system:

env | grep USER | sort

I think you should find out that the variable should be USER. Variable USERNAME only exists on Windows systems as far as I know.

- /home/${USER}/logs/foo.log

Apart from that I would like to know what exactly you are trying to accomplish.
Do you want to u read dynamically through all your user folders?
Something like


and if you add a new user userc it should start to read this one /home/userc/logs/foo.log as well?

If this what you want to do?

Because with that at the moment I assume it will log only one folder.