I have a .conf file that has a label and variable that I’m trying to move to a .env file. How can I accomplish this?
This is what I have in my .conf file
[[inputs.snmp]] #Label agents = ["188.8.131.52:111","184.108.40.206:111","220.127.116.11:111"] #Variable version = 2 #Variable
I’m trying to have something like this in the .env file
VAR_FOR_CONF_FILE='[[inputs.snmp]]n agents= ["18.104.22.168:111","22.214.171.124:111","126.96.36.199:111"]n version=2'
I was hoping I could use
$VAR_FOR_CONF_FILE in my .conf file instead of
[[inputs.snmp]]agents = ["188.8.131.52:111","184.108.40.206:111","220.127.116.11:111"]
but I keep getting this error
Error parsing data: line 7: invalid TOML syntax for
$VAR_FOR_CONF_FILE (Im not sure if I’m getting this error because I have the syntax wrong in my .env file or I’m declaring $VAR_FOR_CONF_FILE incorrectly in my .conf file)
Am I doing it incorrectly (or is it even possible to do what I’m trying to accomplish)?
(Note: I’m trying to accomplish this so I can simply use
$VAR_FOR_CONF_FILE instead of hard coding things in the .conf file)
Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.