[rsyslog-notify] Forum Thread: set config values from env var - (Mode 'post')
noreply at adiscon.com
noreply at adiscon.com
Tue Mar 14 11:35:30 CET 2017
User: aleks
Forumlink: http://kb.monitorware.com/viewtopic.php?p=27191#p27191
Message:
----------
Hi.
I have the following rsyslog.conf.
[code:1n93z21c]#
http://www.rsyslog.com/doc/v8-stable/tutorials/tls_cert_summary.html
global(maxMessageSize="16k" net.ipprotocol="ipv4-only"
environment="no_proxy=http://10.191.0.100")
#
http://www.rsyslog.com/recipe-apache-logs-rsyslog-parsing-elasticsearch/
# queue.spoolDirectory=getenv('RSYS_SPOOL_DIR')
main_queue(
queue.workerThreads="4"
queue.dequeueBatchSize="1000"
queue.highWatermark="500000" # max no. of events to hold in
memory
queue.lowWatermark="200000" # use memory queue again, when it's
back to this level
queue.spoolDirectory="/var/spool/rsyslog" # where to write on disk
queue.fileName="stats_ruleset"
queue.maxDiskSpace="5g" # it will stop at this much disk space
queue.size="5000000" # or this many messages
queue.saveOnShutdown="on" # save memory queue contents to disk
when rsyslog is exiting
)
#module(load="impstats")
#module(load="imuxsock" SysSock.Annotate="on"
SysSock.ParseTrusted="on")
module(load="imtcp" NotifyOnConnectionClose="on" KeepAlive="on")
module(load="lmregexp")
# Include all config files in /etc/rsyslog.d/
$IncludeConfig /etc/rsyslog.d/*.conf[/code:1n93z21c]
I want to set the [b:1n93z21c]queue.spoolDirectory[/b:1n93z21c] via a
environment variable.
[quote:1n93z21c]queue.spoolDirectory=getenv('RSYS_SPOOL_DIR')[/quote:1n93z21c]
I get the following error when I do this.
[quote:1n93z21c]rsyslogd: error during parsing file /etc/rsyslog.conf, on
or before line 17: syntax error on token 'getenv' [v8.25.0 try <!-- m --><a
class="postlink"
href="http://www.rsyslog.com/e/2207">http://www.rsyslog.com/e/2207</a><!--
m --> ][/quote:1n93z21c]
Is it possible to set the config via environment variable?
[code:1n93z21c]/usr/sbin/rsyslogd -version
rsyslogd 8.25.0, compiled with:
PLATFORM: x86_64-redhat-linux-gnu
PLATFORM (lsb_release -d):
FEATURE_REGEXP: Yes
GSSAPI Kerberos 5 support: No
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
[/code:1n93z21c]
More information about the rsyslog-notify
mailing list