I’m encountering an issue with the system-install script provided by Logstash, specifically related to handling special characters in environment variables. Here’s a detailed description of the problem:
Problem
I am using the /usr/share/logstash/bin/system-install
script to configure environment variables for Logstash. However, I am facing difficulties when one of the environment variables, SECRET_KEY, contains an equal sign (=), which appears to be interpreted incorrectly by the script.
Details
- Logstash version: 7.16.3
- Variable Name: SECRET_KEY
- Example Value: nFeTyFoM=
- Affected File: /etc/default/logstash
Symptoms
When the SECRET_ACCESS_KEY contains the equal sign (=), the script fails to populate this variable correctly in the /etc/default/logstash
file.
Removing the equal sign from the SECRET_KEY
allows the script to populate the field as expected.
Suspected Issue
It seems that the /usr/share/logstash/bin/system-install
might be interpreting the equal sign in a way that causes it to fail when writing the variable to the configuration file. I suspect that Systemd or the script might treat the =
character as a special character, leading to the variable being omitted.
Attempts to Resolve
- Escaping Characters: Tried escaping
=
with=
and\=
but without success. - Variable Modification: Modified the value to exclude the = character, which resolved the issue, but this is not a viable solution for the actual use case.
Has anyone encountered a similar issue with system-install or Systemd interpreting special characters like = in environment variables? When using the system-install script, how can I properly handle and include such characters in my environment variables?