So would I do "set $deploy_env = getenv('DEPLOY_ENV')"? How would I then
reference this variable? I'm still trying to learn more about rsyslog
variables and how to use them in templates.

Thanks,
 - Naftuli Kay

On Wed, Oct 25, 2017 at 2:05 PM, deoren <
rsyslog-users-lists.adiscon....@whyaskwhy.org> wrote:

> On 10/25/2017 3:48 PM, Naftuli Kay via rsyslog wrote:
>
>> I have a few environment variables that I'd like to include in my log
>> messages that I'm formatting in JSON format. I have a service that runs on
>> boot which generates /etc/sysconfig/ec2 which contains variables like
>> EC2_INSTANCE_ID, EC2_AMI_ID, etc.
>>
>> If I expose these environment variables to the rsyslog daemon's execution
>> environment, is there a way for me to use them in my templates? The only
>> other alternative that I can see is using a script to template my rsyslog
>> configuration files before starting rsyslog, which seems less than ideal.
>>
>
> http://www.rsyslog.com/doc/v8-stable/rainerscript/functions.
> html#getenv-str
>
> I've not done it myself, but the support appears to be there.
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
> What's up with rsyslog? Follow https://twitter.com/rgerhards
> NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad
> of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you
> DON'T LIKE THAT.
>
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to