-
Notifications
You must be signed in to change notification settings - Fork 641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to read the environmental variable in rsyslog config #2735
Comments
guptarishu
changed the title
Not able to read the env variable
Not able to read the environmental variable in rsyslog config
May 23, 2018
Same issue here, did you find a solution? |
You need to set the variable in the service environment. This is different from your user session environment. |
more precisely, check this: https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service |
Hi Rainer,
Truth, thanks for highlighting that!
That is needed for services running on systemd based OS.
In my case I just pass them as k8s secrets through env vars to the process
running on my pods: rsyslog, this worked like a charm,
As said, thanks a lot for your help.
Regards,
Karl
PS: I found the same issue while publishing the comment (because of extra
chars added by github’s comment format), I edited ‘till reflect the proper
env vars value.
…On Fri, 4 Oct 2019 at 10:10, Rainer Gerhards ***@***.***> wrote:
more precisely, check this:
https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2735?email_source=notifications&email_token=AIGY5RPKEKIMAANDUFP6PA3QM326RA5CNFSM4FBM2YQKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAK3KZY#issuecomment-538293607>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIGY5ROBKNNHXPCOIWY67DDQM326RANCNFSM4FBM2YQA>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
{
"@timestamp": "2018-05-23T21:05:46.919925+00:00",
"host": "10.11.1.1",
"severity": "INFO",
"syslog-tag": "test-Log:",
"tenant": "tenant 1",
"message": "some log"
}
Actual behavior
{
"@timestamp": "2018-05-23T21:05:46.919925+00:00",
"host": "10.11.1.1",
"severity": "INFO",
"syslog-tag": "test-Log:",
"tenant": "",
"message": "some log"
}
Steps to reproduce the behavior
#steps to set the env variable on linux
create file /opt/test.log whose contents are just "some log"
create rsyslog.conf as defined below and restart.
Reading this env variable in rsyslog.conf results in empty string
Environment
rsyslogd 8.24.0, compiled with:
PLATFORM: x86_64-redhat-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
memory allocator: system default
Runtime Instrumentation (slow code): No
uuid support: Yes
Number of Bits in RainerScript integers: 64
###rsyslog.conf
The text was updated successfully, but these errors were encountered: