Hi.

I have the following rsyslog.conf.

###
# 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
###

I want to set the *queue.spoolDirectory* via a environment variable.

queue.spoolDirectory=getenv('RSYS_SPOOL_DIR')


I get the following error when I do this.

rsyslogd: error during parsing file /etc/rsyslog.conf, on or before line 17: syntax error on token 'getenv' [v8.25.0 try http://www.rsyslog.com/e/2207 ]



Is it possible to set the config via environment variable?

    /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

Best regards
Aleks
_______________________________________________
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