From a76a98b08de120f90a2c51fa43a86288ba6aebf8 Mon Sep 17 00:00:00 2001
From: David Lutterkort <lutter@watzmann.net>
Date: Wed, 13 Jun 2018 19:24:38 -0700
Subject: [PATCH] Rsyslog: support include() directive
---
lenses/rsyslog.aug | 2 +-
lenses/tests/test_rsyslog.aug | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/lenses/rsyslog.aug b/lenses/rsyslog.aug
index 6648f3de..35f19a5b 100644
--- a/lenses/rsyslog.aug
+++ b/lenses/rsyslog.aug
@@ -33,7 +33,7 @@ let config_object_param = [ key /[A-Za-z.]+/ . Sep.equal . Quote.dquote
let config_sep = del /[ \t]+|[ \t]*#.*\n[ \t]*/ " "
let config_object =
- [ key /action|global|input|module|parser|timezone/ .
+ [ key /action|global|input|module|parser|timezone|include/ .
Sep.lbracket .
config_object_param . ( config_sep . config_object_param )* .
Sep.rbracket . Util.comment_or_eol ]
diff --git a/lenses/tests/test_rsyslog.aug b/lenses/tests/test_rsyslog.aug
index b71d32c5..5386f836 100644
--- a/lenses/tests/test_rsyslog.aug
+++ b/lenses/tests/test_rsyslog.aug
@@ -199,3 +199,9 @@ test Rsyslog.lns get "module(load=\"imuxsock\" # provides support for local s
{ "SysSock.Use" = "off" }
{ "#comment" = "Turn off message reception via local log socket;" } }
{ "#comment" = "local messages are retrieved through imjournal now." }
+
+(* Added in rsyslog 8.33 *)
+test Rsyslog.lns get "include(file=\"/etc/rsyslog.d/*.conf\" mode=\"optional\")\n" =
+ { "include"
+ { "file" = "/etc/rsyslog.d/*.conf" }
+ { "mode" = "optional" } }
--
2.17.2