summaryrefslogtreecommitdiffstats
path: root/tests/imfile-ignore-old-file-6.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/imfile-ignore-old-file-6.sh')
-rwxr-xr-xtests/imfile-ignore-old-file-6.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/imfile-ignore-old-file-6.sh b/tests/imfile-ignore-old-file-6.sh
new file mode 100755
index 0000000..8bf92f0
--- /dev/null
+++ b/tests/imfile-ignore-old-file-6.sh
@@ -0,0 +1,42 @@
+#! /bin/bash
+# [polling mode] Multiple files with different timestamp, ignore those files with old timestamp
+
+echo [imfile-ignore-old-file-6.sh]
+
+. ${srcdir:=.}/diag.sh init
+generate_conf
+add_conf '
+module(load="../plugins/imfile/.libs/imfile"
+ mode="polling"
+ pollingInterval="2"
+ )
+input(type="imfile"
+ File="./'$RSYSLOG_DYNNAME'.input.1"
+ ignoreolderthan="604800"
+ Tag="file:"
+ ruleset="ruleset")
+input(type="imfile"
+ File="./'$RSYSLOG_DYNNAME'.input.2"
+ ignoreolderthan="604800"
+ Tag="file:"
+ ruleset="ruleset")
+template(name="outfmt" type="string" string="%msg:F,58:2%\n")
+ruleset(name="ruleset") {
+ action(type="omfile" file="'$RSYSLOG_OUT_LOG'" template="outfmt")
+}
+'
+# create log files for testing
+./inputfilegen -m 1000 > $RSYSLOG_DYNNAME.input.1
+touch -m -t 201806010000.00 ./$RSYSLOG_DYNNAME.input.1
+./inputfilegen -m 1000 -i 1000 > $RSYSLOG_DYNNAME.input.2
+
+startup
+# sleep a little to give rsyslog a chance to begin processing
+./msleep 500
+# shut down rsyslogd when done processing messages
+shutdown_when_empty
+# we need to wait until rsyslogd is finished!
+wait_shutdown
+# check log file
+seq_check 1000 1999
+exit_test