
module(load="imfile" PollingInterval="1")
# Input for FILE1
#wildcard is allowed at file level only
input(
      type="imfile" 
      tag="Nginxlog" 
      ruleset="filelog"
      Facility="local0"
      Severity="info" 
      PersistStateInterval="1" 
      reopenOnTruncate="on" 
      freshStartTail="on" 
      file="/var/log/nginx/*.log"
) 

# Define a template for file events
template(name="DASLoggerFormatFilelog" type="string" string="%msg%\n")

#Replace the Target and Port values with your DAS-Logger IP address and port.
ruleset(name="filelog") {
   action(
        type="omfwd" 
        protocol="udp" 
        target="LOGIP" 
        port="514" 
        template="DASLoggerFormatFilelog" 
        queue.type="LinkedList"
        queue.filename="fileq1"
        queue.saveonshutdown="on"
        action.resumeRetryCount="-1"
   ) stop
}

