Use the </> code button when sharing code or config.
It looks that your yml does not have the correct format and you need to use ${} around your variable, I would also recommend to use quotes around your config.
Setting the variables on a bashrc script won't work if you are running filebeat as a service, the variables set this way will only be available for a login shell, and filebeat does not start a login shell when running.
The best solution in your case, since you are using systemd, is to create an Environment File and configure your service to read the variables from this file.
To do that you can create a file in the directory /etc/systemd/system/filebeat.service.d/ or use systemctl edit filebeat.service to create a file in the same directory, with the following content.
[Service]
EnvironmentFile=/etc/filebeat/envs
This way when filebeat starts it will look for the envs file inside /etc/filebeat/ with environment variables.
In the envs file you will have your variables.
DATE_D=30
DATE_Y=2020
DATE_M=10
You need to run systemctl daemon-reload and systemctl restart filebeat to apply the changes.
But since your variables are dynamic and changes every day, you will need to create a script to change the envs file everyday em restart filebeat when the day changes.
If you don't want to do all that, you can set the variables from your bashrc script, but you will need to run filebeat using the command line.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.