diff --git a/SOURCES/rsyslog-8.24.0-doc-polling-by-default.patch b/SOURCES/rsyslog-8.24.0-doc-polling-by-default.patch
index 581be48..d7848c5 100644
--- a/SOURCES/rsyslog-8.24.0-doc-polling-by-default.patch
+++ b/SOURCES/rsyslog-8.24.0-doc-polling-by-default.patch
@@ -1,25 +1,18 @@
-diff -up ./doc/configuration/modules/imfile.html.orig ./doc/configuration/modules/imfile.html
---- ./doc/configuration/modules/imfile.html.orig	2016-11-24 10:52:53.192779734 -0500
-+++ ./doc/configuration/modules/imfile.html	2016-11-24 11:01:07.132961531 -0500
-@@ -152,11 +152,12 @@ parts of that file.</p>
- <dt>
- <code class="descname">mode [&quot;inotify&quot;/&quot;polling&quot;]</code></dt>
- <dd><blockquote>
--<div><p><em>Default: &#8220;inotify&#8221;</em></p>
-+<div><p><em>Default: &#8220;polling&#8221;</em></p>
- <p><em>Available since: 8.1.5</em></p>
- </div></blockquote>
- <p>This specifies if imfile is shall run in inotify (&#8220;inotify&#8221;) or polling
--(&#8220;polling&#8221;) mode. Traditionally, imfile used polling mode, which is
-+(&#8220;polling&#8221;) mode. Traditionally, imfile used polling mode (and this option 
-+is ON by default in rhel because of backwards compatibility), which is
- much more resource-intense (and slower) than inotify mode. It is
- suggested that users turn on &#8220;polling&#8221; mode only if they experience
- strange problems in inotify mode. In theory, there should never be a
-@@ -675,4 +676,4 @@ $InputFilePollInterval 10
-         &copy; Copyright 2008-2016, Rainer Gerhards and Adiscon.
-     </div>
-   </body>
--</html>
-\ No newline at end of file
-+</html>
+--- a/source/configuration/modules/imfile.rst	2017-10-31 10:28:39.582763203 +0100
++++ b/source/configuration/modules/imfile.rst	2017-10-31 10:29:52.961142905 +0100
+@@ -100,12 +100,13 @@
+    single: imfile; mode
+ .. function:: mode ["inotify"/"polling"]
+ 
+-   *Default: "inotify"*
++   *Default: "polling"*
+ 
+    *Available since: 8.1.5*
+ 
+   This specifies if imfile is shall run in inotify ("inotify") or polling
+-  ("polling") mode. Traditionally, imfile used polling mode, which is
++  ("polling") mode. Traditionally, imfile used polling mode (and this option 
++  is ON by default in RHEL because of backwards compatibility), which is
+   much more resource-intense (and slower) than inotify mode. It is
+   suggested that users turn on "polling" mode only if they experience
+   strange problems in inotify mode. In theory, there should never be a
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1188503-imjournal-default-tag.patch b/SOURCES/rsyslog-8.24.0-rhbz1188503-imjournal-default-tag.patch
deleted file mode 100644
index 84d82e6..0000000
--- a/SOURCES/rsyslog-8.24.0-rhbz1188503-imjournal-default-tag.patch
+++ /dev/null
@@ -1,163 +0,0 @@
-From 5fb2e24e4820b4ae206eb250be8d464fcb97879f Mon Sep 17 00:00:00 2001
-From: Tomas Sykora <tosykora@redhat.com>
-Date: Tue, 15 Nov 2016 06:32:58 -0500
-Subject: [PATCH 3/4] Rebased from: Patch21:
- rsyslog-7.4.7-rhbz1188503-imjournal-default-tag.patch
-
-Resolves:
-rhbz#1188503
----
- plugins/imjournal/imjournal.c | 63 ++++++++++++++++++++++++++++---------------
- 1 file changed, 42 insertions(+), 21 deletions(-)
-
-diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c
-index 41fe8c6..d4ea0d5 100644
---- a/plugins/imjournal/imjournal.c
-+++ b/plugins/imjournal/imjournal.c
-@@ -76,6 +76,7 @@ static struct configSettings_s {
- 	int iDfltSeverity;
- 	int iDfltFacility;
- 	int bUseJnlPID;
-+	char *dfltTag;
- } cs;
- 
- static rsRetVal facilityHdlr(uchar **pp, void *pVal);
-@@ -90,6 +91,7 @@ static struct cnfparamdescr modpdescr[] = {
- 	{ "defaultseverity", eCmdHdlrSeverity, 0 },
- 	{ "defaultfacility", eCmdHdlrString, 0 },
- 	{ "usepidfromsystem", eCmdHdlrBinary, 0 },
-+	{ "defaulttag", eCmdHdlrGetWord, 0 },
- };
- static struct cnfparamblk modpblk =
- 	{ CNFPARAMBLK_VERSION,
-@@ -100,6 +102,7 @@ static struct cnfparamblk modpblk =
- #define DFLT_persiststateinterval 10
- #define DFLT_SEVERITY pri2sev(LOG_NOTICE)
- #define DFLT_FACILITY pri2fac(LOG_USER)
-+#define DFLT_TAG "journal"
- 
- static int bLegacyCnfModGlobalsPermitted = 1;/* are legacy module-global config parameters permitted? */
- 
-@@ -191,8 +194,13 @@ enqMsg(uchar *msg, uchar *pszTag, int iFacility, int iSeverity, struct timeval *
- 	}
- 	MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY);
- 	MsgSetInputName(pMsg, pInputName);
-+	/* Recalculating the message length shouldn't cause problems as all
-+ 	 * potential zero-bytes have been excaped in sanitizeValue(). */ 	
- 	len = strlen((char*)msg);
- 	MsgSetRawMsg(pMsg, (char*)msg, len);
-+	/* NB: SanitizeMsg() only touches the raw message and its
-+ 	 * length which only contain the msg part. Thus the TAG and
-+ 	 * other fields are not sanitized. */ 
- 	if(len > 0)
- 		parser.SanitizeMsg(pMsg);
- 	MsgSetMSGoffs(pMsg, 0);	/* we do not have a header... */
-@@ -230,7 +238,7 @@ readjournal(void)
- 
- 	/* Information from messages */
- 	char *message = NULL;
--	char *sys_iden;
-+	char *sys_iden = NULL;
- 	char *sys_iden_help = NULL;
- 
- 	const void *get;
-@@ -291,29 +299,34 @@ readjournal(void)
- 	/* Get message identifier, client pid and add ':' */
- 	if (sd_journal_get_data(j, "SYSLOG_IDENTIFIER", &get, &length) >= 0) {
- 		CHKiRet(sanitizeValue(((const char *)get) + 18, length - 18, &sys_iden));
--	} else {
--		CHKmalloc(sys_iden = strdup("journal"));
- 	}
- 
--	if (sd_journal_get_data(j, pid_field_name, &pidget, &pidlength) >= 0) {
--		char *sys_pid;
--		int val_ofs;
--
--		val_ofs = strlen(pid_field_name) + 1; /* name + '=' */
--		CHKiRet_Hdlr(sanitizeValue(((const char *)pidget) + val_ofs, pidlength - val_ofs, &sys_pid)) {
--			free (sys_iden);
--			FINALIZE;
-+	if (sys_iden == NULL && !cs.dfltTag[0]) {
-+               /* This is a special case: if no tag was obtained from
-+                * the message and the user has set the default tag to
-+                * an empty string, nothing is inserted.
-+                */
-+               CHKmalloc(sys_iden_help = calloc(1, 1));
-+       	} else {
-+        	if (sys_iden == NULL) {
-+                	/* Use a predefined tag if it can't be obtained from the message */
-+                        CHKmalloc(sys_iden = strdup(cs.dfltTag));
-+               	}
-+               	if (sd_journal_get_data(j, "SYSLOG_PID", &pidget, &pidlength) >= 0) {
-+                	char *sys_pid;
-+                        CHKiRet_Hdlr(sanitizeValue(((const char *)pidget) + 11, pidlength - 11, &sys_pid)) {
-+                                free (sys_iden);
-+                                FINALIZE;
-+                        }
-+                        r = asprintf(&sys_iden_help, "%s[%s]:", sys_iden, sys_pid);
-+                        free (sys_pid);
-+                } else {
-+                        r = asprintf(&sys_iden_help, "%s:", sys_iden);
-+		}
-+		free (sys_iden);
-+		if (-1 == r) {
-+			ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
- 		}
--		r = asprintf(&sys_iden_help, "%s[%s]:", sys_iden, sys_pid);
--		free (sys_pid);
--	} else {
--		r = asprintf(&sys_iden_help, "%s:", sys_iden);
--	}
--
--	free (sys_iden);
--
--	if (-1 == r) {
--		ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
- 	}
- 
- 	json = json_object_new_object();
-@@ -606,12 +619,15 @@ CODESTARTbeginCnfLoad
- 	cs.ratelimitInterval = 600;
- 	cs.iDfltSeverity = DFLT_SEVERITY;
- 	cs.iDfltFacility = DFLT_FACILITY;
-+	cs.dfltTag = NULL;
- 	cs.bUseJnlPID = 0;
- ENDbeginCnfLoad
- 
- 
- BEGINendCnfLoad
- CODESTARTendCnfLoad
-+	if (cs.dfltTag == NULL)
-+		cs.dfltTag = strdup(DFLT_TAG);
- ENDendCnfLoad
- 
- 
-@@ -628,6 +644,7 @@ ENDactivateCnf
- BEGINfreeCnf
- CODESTARTfreeCnf
- 	free(cs.stateFile);
-+	free(cs.dfltTag);
- ENDfreeCnf
- 
- /* open journal */
-@@ -710,6 +727,8 @@ CODESTARTsetModCnf
- 			free(fac);
- 		} else if (!strcmp(modpblk.descr[i].name, "usepidfromsystem")) {
- 			cs.bUseJnlPID = (int) pvals[i].val.d.n;
-+		} else if (!strcmp(modpblk.descr[i].name, "defaulttag")) {
-+			cs.dfltTag = (char *)es_str2cstr(pvals[i].val.d.estr, NULL);
- 		} else {
- 			dbgprintf("imjournal: program error, non-handled "
- 				"param '%s' in beginCnfLoad\n", modpblk.descr[i].name);
-@@ -770,6 +789,8 @@ CODEmodInit_QueryRegCFSLineHdlr
- 		facilityHdlr, &cs.iDfltFacility, STD_LOADABLE_MODULE_ID));
- 	CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalusepidfromsystem", 0, eCmdHdlrBinary,
- 		NULL, &cs.bUseJnlPID, STD_LOADABLE_MODULE_ID));
-+	CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournaldefaulttag", 0, eCmdHdlrGetWord,
-+		NULL, &cs.dfltTag, STD_LOADABLE_MODULE_ID));
- ENDmodInit
- /* vim:set ai:
-  */
--- 
-2.7.4
-
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1286707-recover_qi-doc.patch b/SOURCES/rsyslog-8.24.0-rhbz1286707-recover_qi-doc.patch
deleted file mode 100644
index 42a69b1..0000000
--- a/SOURCES/rsyslog-8.24.0-rhbz1286707-recover_qi-doc.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From ff07a7cfc171dc2151cc8afe44776525d34a9e01 Mon Sep 17 00:00:00 2001
-From: jvymazal <jvymazal@redhat.com>
-Date: Tue, 3 Jan 2017 10:24:26 +0100
-Subject: [PATCH] Update queues.rst
-
-Update queues.rst
----
- source/concepts/queues.rst | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/source/concepts/queues.rst b/source/concepts/queues.rst
-index eb394e8..c71413c 100644
---- a/source/concepts/queues.rst
-+++ b/source/concepts/queues.rst
-@@ -153,6 +153,12 @@ can be requested via "*<object>QueueSyncQueueFiles on/off* with the
- default being off. Activating this option has a performance penalty, so
- it should not be turned on without reason.
- 
-+If you happen to lose or otherwise need the housekeeping structures and 
-+have all yours queue chunks you can use perl script included in rsyslog
-+package to generate it. 
-+Usage: recover_qi.pl -w *$WorkDirectory* -f QueueFileName -d 8 > QueueFileName.qi
-+
-+
- In-Memory Queues
- ~~~~~~~~~~~~~~~~
- 
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1401456-sd-service-network.patch b/SOURCES/rsyslog-8.24.0-rhbz1401456-sd-service-network.patch
new file mode 100644
index 0000000..f3cbf26
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1401456-sd-service-network.patch
@@ -0,0 +1,12 @@
+diff -up ./rsyslog.service.in.network ./rsyslog.service.in
+--- ./rsyslog.service.in.network	2017-08-30 09:19:50.845218557 -0400
++++ ./rsyslog.service.in	2017-08-30 09:21:34.141218557 -0400
+@@ -1,6 +1,8 @@
+ [Unit]
+ Description=System Logging Service
+ Requires=syslog.socket
++Wants=network.target network-online.target
++After=network.target network-online.target
+ Documentation=man:rsyslogd(8)
+ Documentation=http://www.rsyslog.com/doc/
+ 
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1459896-queues-defaults-doc.patch b/SOURCES/rsyslog-8.24.0-rhbz1459896-queues-defaults-doc.patch
new file mode 100644
index 0000000..e7bdc91
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1459896-queues-defaults-doc.patch
@@ -0,0 +1,138 @@
+From c8be9a713a57f07311560af50c24267b30bef21b Mon Sep 17 00:00:00 2001
+From: Jiri Vymazal <jvymazal@redhat.com>
+Date: Tue, 29 Aug 2017 16:32:15 +0200
+Subject: [PATCH] fixed queue default values
+
+---
+ source/concepts/queues.rst                                       | 7 +++----
+ source/configuration/global/index.rst                            | 6 +++---
+ source/configuration/global/options/rsconf1_mainmsgqueuesize.rst | 2 +-
+ source/rainerscript/queue_parameters.rst                         | 15 ++++++++++++---
+ source/configuration/action/index.rst                            | 12 ++++++------
+ 5 files changed, 24 insertions(+), 16 deletions(-)
+
+diff --git a/source/concepts/queues.rst b/source/concepts/queues.rst
+index c71413c..9b41128 100644
+--- a/source/concepts/queues.rst
++++ b/source/concepts/queues.rst
+@@ -273,10 +273,9 @@ actually needed.
+ The water marks can be set via the "*$<object>QueueHighWatermark*\ "
+ and  "*$<object>QueueLowWatermark*\ " configuration file directives.
+ Note that these are actual numbers, not percentages. Be sure they make
+-sense (also in respect to "*$<object>QueueSize*\ "), as rsyslodg does
+-currently not perform any checks on the numbers provided. It is easy to
+-screw up the system here (yes, a feature enhancement request is filed
+-;)).
++sense (also in respect to "*$<object>QueueSize*\ "). Rsyslodg does
++perform some checks on the numbers provided, and issues warning when
++numbers are "suspicious".
+ 
+ Limiting the Queue Size
+ -----------------------
+diff --git a/source/configuration/global/index.rst b/source/configuration/global/index.rst
+index 2738f21..a53ef23 100644
+--- a/source/configuration/global/index.rst
++++ b/source/configuration/global/index.rst
+@@ -137,13 +137,13 @@ To understand queue parameters, read
+ -  **$MainMsgQueueDequeueSlowdown** <number> [number is timeout in
+    *micro*\ seconds (1000000us is 1sec!), default 0 (no delay). Simple
+    rate-limiting!]
+--  **$MainMsgQueueDiscardMark** <number> [default 9750]
++-  **$MainMsgQueueDiscardMark** <number> [default 98000]
+ -  **$MainMsgQueueDiscardSeverity** <severity> [either a textual or
+    numerical severity! default 4 (warning)]
+ -  **$MainMsgQueueFileName** <name>
+--  **$MainMsgQueueHighWaterMark** <number> [default 8000]
++-  **$MainMsgQueueHighWaterMark** <number> [default 80000]
+ -  **$MainMsgQueueImmediateShutdown** [on/**off**]
+--  **$MainMsgQueueLowWaterMark** <number> [default 2000]
++-  **$MainMsgQueueLowWaterMark** <number> [default 20000]
+ -  **$MainMsgQueueMaxFileSize** <size\_nbr>, default 1m
+ -  **$MainMsgQueueTimeoutActionCompletion** <number> [number is timeout in
+    ms (1000ms is 1sec!), default 1000, 0 means immediate!]
+diff --git a/source/configuration/global/options/rsconf1_mainmsgqueuesize.rst b/source/configuration/global/options/rsconf1_mainmsgqueuesize.rst
+index 050407c..3e902cf 100644
+--- a/source/configuration/global/options/rsconf1_mainmsgqueuesize.rst
++++ b/source/configuration/global/options/rsconf1_mainmsgqueuesize.rst
+@@ -3,7 +3,7 @@ $MainMsgQueueSize
+ 
+ **Type:** global configuration directive
+ 
+-**Default:** 10000
++**Default:** 100000
+ 
+ **Description:**
+ 
+diff --git a/source/rainerscript/queue_parameters.rst b/source/rainerscript/queue_parameters.rst
+index 4453721..3f2b7a2 100644
+--- a/source/rainerscript/queue_parameters.rst
++++ b/source/rainerscript/queue_parameters.rst
+@@ -33,8 +33,14 @@ read the :doc:`queues <../concepts/queues>` documentation.
+    For more information on the current status of this restriction see
+    the `rsyslog FAQ: "lower bound for queue
+    sizes" <http://www.rsyslog.com/lower-bound-for-queue-sizes/>`_.
++
++   The default depends on queue type and, if you need
++   a specific value, please specify it. Otherwise rsyslog selects what
++   it consideres appropriate. For example, ruleset queues have a default
++   size of 50000 and action queues which are configured to be non-direct
++   have a size of 1000.
+ -  **queue.dequeuebatchsize** number
+-   default 16
++   default 128
+ -  **queue.maxdiskspace** number
+    The maximum size that all queue files together will use on disk. Note
+    that the actual size may be slightly larger than the configured max,
+@@ -46,8 +47,9 @@ read the :doc:`queues <../concepts/queues>` documentation.
+    processing, because disk queue mode is very considerably slower than
+    in-memory queue mode. Going to disk should be reserved for cases
+    where an output action destination is offline for some period.
++   default 90% of queue size
+ -  **queue.lowwatermark** number
+-   default 2000
++   default 70% of queue size
+ -  **queue.fulldelaymark** number 
+    Number of messages when the queue should block delayable messages. 
+    Messages are NO LONGER PROCESSED until the queue has sufficient space 
+@@ -59,9 +61,11 @@ read the :doc:`queues <../concepts/queues>` documentation.
+    out of space. Please note that if you use a DA queue, setting the 
+    fulldelaymark BELOW the highwatermark makes the queue never activate 
+    disk mode for delayable inputs. So this is probably not what you want.
++   default 97% of queue size
+ -  **queue.lightdelaymark** number
++   default 70% of queue size
+ -  **queue.discardmark** number
+-   default 9750
++   default 80% of queue size
+ -  **queue.discardseverity** number
+    \*numerical\* severity! default 8 (nothing discarded)
+ -  **queue.checkpointinterval** number
+diff --git a/source/configuration/action/index.rst b/source/configuration/action/index.rst
+index 3e7cd24..9352866 100644
+--- a/source/configuration/action/index.rst
++++ b/source/configuration/action/index.rst
+@@ -163,18 +163,18 @@ following action, only. The next and all other actions will be
+ in "direct" mode (no real queue) if not explicitely specified otherwise.
+
+ -  **$ActionQueueCheckpointInterval** <number>
+--  **$ActionQueueDequeueBatchSize** <number> [default 16]
++-  **$ActionQueueDequeueBatchSize** <number> [default 128]
+ -  **$ActionQueueDequeueSlowdown** <number> [number is timeout in
+    *micro*\ seconds (1000000us is 1sec!), default 0 (no delay). Simple
+    rate-limiting!]
+--  **$ActionQueueDiscardMark** <number> [default 9750]
+--  **$ActionQueueDiscardSeverity** <number> [\*numerical\* severity! default
+-   4 (warning)]
++-  **$ActionQueueDiscardMark** <number> [default 80% of queue size]
++-  **$ActionQueueDiscardSeverity** <number> [\*numerical\* severity! default
++   8 (nothing discarded)]
+ -  **$ActionQueueFileName** <name>
+--  **$ActionQueueHighWaterMark** <number> [default 8000]
++-  **$ActionQueueHighWaterMark** <number> [default 90% of queue size]
+ -  **$ActionQueueImmediateShutdown** [on/**off**]
+ -  **$ActionQueueSize** <number>
+--  **$ActionQueueLowWaterMark** <number> [default 2000]
++-  **$ActionQueueLowWaterMark** <number> [default 70% of queue size]
+ -  **$ActionQueueMaxFileSize** <size\_nbr>, default 1m
+ -  **$ActionQueueTimeoutActionCompletion** <number> [number is timeout in ms
+    (1000ms is 1sec!), default 1000, 0 means immediate!]
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1462160-set.statement-crash.patch b/SOURCES/rsyslog-8.24.0-rhbz1462160-set.statement-crash.patch
new file mode 100644
index 0000000..112f75c
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1462160-set.statement-crash.patch
@@ -0,0 +1,150 @@
+diff -up ./plugins/imjournal/imjournal.c.default_tag ./plugins/imjournal/imjournal.c
+--- ./plugins/imjournal/imjournal.c.default_tag	2017-01-10 04:00:04.000000000 -0500
++++ ./plugins/imjournal/imjournal.c	2017-08-28 07:55:19.545930923 -0400
+@@ -78,6 +78,7 @@ static struct configSettings_s {
+ 	int iDfltSeverity;
+ 	int iDfltFacility;
+ 	int bUseJnlPID;
++	char *dfltTag;
+ } cs;
+ 
+ static rsRetVal facilityHdlr(uchar **pp, void *pVal);
+@@ -93,6 +94,7 @@ static struct cnfparamdescr modpdescr[]
+ 	{ "defaultseverity", eCmdHdlrSeverity, 0 },
+ 	{ "defaultfacility", eCmdHdlrString, 0 },
+ 	{ "usepidfromsystem", eCmdHdlrBinary, 0 },
++	{ "defaulttag", eCmdHdlrGetWord, 0 },
+ };
+ static struct cnfparamblk modpblk =
+ 	{ CNFPARAMBLK_VERSION,
+@@ -103,6 +105,7 @@ static struct cnfparamblk modpblk =
+ #define DFLT_persiststateinterval 10
+ #define DFLT_SEVERITY pri2sev(LOG_NOTICE)
+ #define DFLT_FACILITY pri2fac(LOG_USER)
++#define DFLT_TAG "journal"
+ 
+ static int bLegacyCnfModGlobalsPermitted = 1;/* are legacy module-global config parameters permitted? */
+ 
+@@ -194,8 +197,13 @@ enqMsg(uchar *msg, uchar *pszTag, int iF
+ 	}
+ 	MsgSetFlowControlType(pMsg, eFLOWCTL_LIGHT_DELAY);
+ 	MsgSetInputName(pMsg, pInputName);
++	/* Recalculating the message length shouldn't cause problems as all
++ 	 * potential zero-bytes have been excaped in sanitizeValue(). */ 	
+ 	len = strlen((char*)msg);
+ 	MsgSetRawMsg(pMsg, (char*)msg, len);
++	/* NB: SanitizeMsg() only touches the raw message and its
++ 	 * length which only contain the msg part. Thus the TAG and
++ 	 * other fields are not sanitized. */ 
+ 	if(len > 0)
+ 		parser.SanitizeMsg(pMsg);
+ 	MsgSetMSGoffs(pMsg, 0);	/* we do not have a header... */
+@@ -233,7 +241,7 @@ readjournal(void)
+ 
+ 	/* Information from messages */
+ 	char *message = NULL;
+-	char *sys_iden;
++	char *sys_iden = NULL;
+ 	char *sys_iden_help = NULL;
+ 
+ 	const void *get;
+@@ -294,29 +302,34 @@ readjournal(void)
+ 	/* Get message identifier, client pid and add ':' */
+ 	if (sd_journal_get_data(j, "SYSLOG_IDENTIFIER", &get, &length) >= 0) {
+ 		CHKiRet(sanitizeValue(((const char *)get) + 18, length - 18, &sys_iden));
+-	} else {
+-		CHKmalloc(sys_iden = strdup("journal"));
+ 	}
+ 
+-	if (sd_journal_get_data(j, pid_field_name, &pidget, &pidlength) >= 0) {
+-		char *sys_pid;
+-		int val_ofs;
+-
+-		val_ofs = strlen(pid_field_name) + 1; /* name + '=' */
+-		CHKiRet_Hdlr(sanitizeValue(((const char *)pidget) + val_ofs, pidlength - val_ofs, &sys_pid)) {
+-			free (sys_iden);
+-			FINALIZE;
++	if (sys_iden == NULL && !cs.dfltTag[0]) {
++               /* This is a special case: if no tag was obtained from
++                * the message and the user has set the default tag to
++                * an empty string, nothing is inserted.
++                */
++               CHKmalloc(sys_iden_help = calloc(1, 1));
++       	} else {
++        	if (sys_iden == NULL) {
++                	/* Use a predefined tag if it can't be obtained from the message */
++                        CHKmalloc(sys_iden = strdup(cs.dfltTag));
++               	}
++               	if (sd_journal_get_data(j, "SYSLOG_PID", &pidget, &pidlength) >= 0) {
++                	char *sys_pid;
++                        CHKiRet_Hdlr(sanitizeValue(((const char *)pidget) + 11, pidlength - 11, &sys_pid)) {
++                                free (sys_iden);
++                                FINALIZE;
++                        }
++                        r = asprintf(&sys_iden_help, "%s[%s]:", sys_iden, sys_pid);
++                        free (sys_pid);
++                } else {
++                        r = asprintf(&sys_iden_help, "%s:", sys_iden);
++		}
++		free (sys_iden);
++		if (-1 == r) {
++			ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
+ 		}
+-		r = asprintf(&sys_iden_help, "%s[%s]:", sys_iden, sys_pid);
+-		free (sys_pid);
+-	} else {
+-		r = asprintf(&sys_iden_help, "%s:", sys_iden);
+-	}
+-
+-	free (sys_iden);
+-
+-	if (-1 == r) {
+-		ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY);
+ 	}
+ 
+ 	json = json_object_new_object();
+@@ -585,6 +598,10 @@ CODESTARTrunInput
+ 		pid_field_name = "SYSLOG_PID";
+ 	}
+ 
++	if (cs.dfltTag == NULL) {
++		cs.dfltTag = strdup(DFLT_TAG);
++	}
++
+ 	/* this is an endless loop - it is terminated when the thread is
+ 	 * signalled to do so. This, however, is handled by the framework.
+ 	 */
+@@ -633,6 +650,7 @@ CODESTARTbeginCnfLoad
+ 	cs.ratelimitInterval = 600;
+ 	cs.iDfltSeverity = DFLT_SEVERITY;
+ 	cs.iDfltFacility = DFLT_FACILITY;
++	cs.dfltTag = NULL;
+ 	cs.bUseJnlPID = 0;
+ ENDbeginCnfLoad
+ 
+@@ -655,6 +673,7 @@ ENDactivateCnf
+ BEGINfreeCnf
+ CODESTARTfreeCnf
+ 	free(cs.stateFile);
++	free(cs.dfltTag);
+ ENDfreeCnf
+ 
+ /* open journal */
+@@ -739,6 +758,8 @@ CODESTARTsetModCnf
+ 			free(fac);
+ 		} else if (!strcmp(modpblk.descr[i].name, "usepidfromsystem")) {
+ 			cs.bUseJnlPID = (int) pvals[i].val.d.n;
++		} else if (!strcmp(modpblk.descr[i].name, "defaulttag")) {
++			cs.dfltTag = (char *)es_str2cstr(pvals[i].val.d.estr, NULL);
+ 		} else {
+ 			dbgprintf("imjournal: program error, non-handled "
+ 				"param '%s' in beginCnfLoad\n", modpblk.descr[i].name);
+@@ -799,6 +820,8 @@ CODEmodInit_QueryRegCFSLineHdlr
+ 		facilityHdlr, &cs.iDfltFacility, STD_LOADABLE_MODULE_ID));
+ 	CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournalusepidfromsystem", 0, eCmdHdlrBinary,
+ 		NULL, &cs.bUseJnlPID, STD_LOADABLE_MODULE_ID));
++	CHKiRet(omsdRegCFSLineHdlr((uchar *)"imjournaldefaulttag", 0, eCmdHdlrGetWord,
++		NULL, &cs.dfltTag, STD_LOADABLE_MODULE_ID));
+ ENDmodInit
+ /* vim:set ai:
+  */
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1488186-fixed-nullptr-check.patch b/SOURCES/rsyslog-8.24.0-rhbz1488186-fixed-nullptr-check.patch
new file mode 100644
index 0000000..19f84d4
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1488186-fixed-nullptr-check.patch
@@ -0,0 +1,27 @@
+From a5b40bb57cf47d964ad3873ddf550e7885df9f8e Mon Sep 17 00:00:00 2001
+From: Marek Tamaskovic <tamaskovic.marek@gmail.com>
+Date: Wed, 6 Sep 2017 17:08:45 +0200
+Subject: [PATCH] fixed nullptr check
+
+---
+ plugins/imjournal/imjournal.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/plugins/imjournal/imjournal.c b/plugins/imjournal/imjournal.c
+index e3e0f39..938e8b8 100644
+--- a/plugins/imjournal/imjournal.c
++++ b/plugins/imjournal/imjournal.c
+@@ -514,7 +514,9 @@ pollJournal(void)
+ 			ABORT_FINALIZE(RS_RET_ERR);
+ 		}
+ 
+-		iRet = loadJournalState();
++		if(cs.stateFile != NULL){
++			iRet = loadJournalState();
++		}
+ 		LogMsg(0, RS_RET_OK, LOG_NOTICE, "imjournal: journal reloaded...");
+ 	} else if (jr < 0) {
+ 		char errStr[256];
+-- 
+2.9.5
+
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1497985-journal-reloaded-message.patch b/SOURCES/rsyslog-8.24.0-rhbz1497985-journal-reloaded-message.patch
new file mode 100644
index 0000000..31237c4
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1497985-journal-reloaded-message.patch
@@ -0,0 +1,46 @@
+diff -up ./plugins/imjournal/imjournal.c.journal-reloaded ./plugins/imjournal/imjournal.c
+--- ./plugins/imjournal/imjournal.c.journal-reloaded	2017-10-09 11:05:53.698885473 -0400
++++ ./plugins/imjournal/imjournal.c	2017-10-09 11:08:54.179885473 -0400
+@@ -509,8 +509,7 @@ pollJournal(void)
+ 		}
+ 
+ 		iRet = loadJournalState();
+-		errmsg.LogError(0, RS_RET_OK, "imjournal: "
+-			"journal reloaded...");	
++		LogMsg(0, RS_RET_OK, LOG_NOTICE, "imjournal: journal reloaded...");
+ 	} else if (jr < 0) {
+ 		char errStr[256];
+ 		rs_strerror_r(errno, errStr, sizeof(errStr));
+diff -up ./runtime/errmsg.c.journal-reloaded ./runtime/errmsg.c
+--- ./runtime/errmsg.c.journal-reloaded	2016-12-03 12:41:03.000000000 -0500
++++ ./runtime/errmsg.c	2017-10-09 11:05:53.704885473 -0400
+@@ -115,7 +115,7 @@ doLogMsg(const int iErrno, const int iEr
+  * maps to a specific error event).
+  * rgerhards, 2008-06-27
+  */
+-static void __attribute__((format(printf, 3, 4)))
++void __attribute__((format(printf, 3, 4)))
+ LogError(const int iErrno, const int iErrCode, const char *fmt, ... )
+ {
+ 	va_list ap;
+@@ -144,7 +144,7 @@ LogError(const int iErrno, const int iEr
+  * maps to a specific error event).
+  * rgerhards, 2008-06-27
+  */
+-static void __attribute__((format(printf, 4, 5)))
++void __attribute__((format(printf, 4, 5)))
+ LogMsg(const int iErrno, const int iErrCode, const int severity, const char *fmt, ... )
+ {
+ 	va_list ap;
+diff -up ./runtime/errmsg.h.journal-reloaded ./runtime/errmsg.h
+--- ./runtime/errmsg.h.journal-reloaded	2016-12-03 12:41:03.000000000 -0500
++++ ./runtime/errmsg.h	2017-10-09 11:05:53.704885473 -0400
+@@ -44,5 +44,8 @@ ENDinterface(errmsg)
+ PROTOTYPEObj(errmsg);
+ void resetErrMsgsFlag(void);
+ int hadErrMsgs(void);
++void __attribute__((format(printf, 3, 4))) LogError(const int iErrno, const int iErrCode, const char *fmt, ... );
++void __attribute__((format(printf, 4, 5)))
++	LogMsg(const int iErrno, const int iErrCode, const int severity, const char *fmt, ... );
+ 
+ #endif /* #ifndef INCLUDED_ERRMSG_H */
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1505103-omrelp-rebindinterval.patch b/SOURCES/rsyslog-8.24.0-rhbz1505103-omrelp-rebindinterval.patch
new file mode 100644
index 0000000..39fda2b
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1505103-omrelp-rebindinterval.patch
@@ -0,0 +1,28 @@
+From cc09e7a6e893157a4d7a173c78f4b0a0496e8fbd Mon Sep 17 00:00:00 2001
+From: Rainer Gerhards <rgerhards@adiscon.com>
+Date: Thu, 28 Sep 2017 19:08:35 +0200
+Subject: [PATCH] omrelp bugfix: segfault if rebindinterval config param is
+ used
+
+closes https://github.com/rsyslog/rsyslog/issues/120
+---
+ plugins/omrelp/omrelp.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/plugins/omrelp/omrelp.c b/plugins/omrelp/omrelp.c
+index 3df062e0e..d32a66e07 100644
+--- a/plugins/omrelp/omrelp.c
++++ b/plugins/omrelp/omrelp.c
+@@ -566,8 +566,10 @@ ENDdoAction
+
+ BEGINendTransaction
+ CODESTARTendTransaction
+-	dbgprintf("omrelp: endTransaction\n");
+-	relpCltHintBurstEnd(pWrkrData->pRelpClt);
++	DBGPRINTF("omrelp: endTransaction, connected %d\n", pWrkrData->bIsConnected);
++	if(pWrkrData->bIsConnected) {
++		relpCltHintBurstEnd(pWrkrData->pRelpClt);
++	}
+ ENDendTransaction
+
+ BEGINparseSelectorAct
diff --git a/SOURCES/rsyslog-8.24.0-rhbz1507028-recover_qi-doc.patch b/SOURCES/rsyslog-8.24.0-rhbz1507028-recover_qi-doc.patch
new file mode 100644
index 0000000..42a69b1
--- /dev/null
+++ b/SOURCES/rsyslog-8.24.0-rhbz1507028-recover_qi-doc.patch
@@ -0,0 +1,27 @@
+From ff07a7cfc171dc2151cc8afe44776525d34a9e01 Mon Sep 17 00:00:00 2001
+From: jvymazal <jvymazal@redhat.com>
+Date: Tue, 3 Jan 2017 10:24:26 +0100
+Subject: [PATCH] Update queues.rst
+
+Update queues.rst
+---
+ source/concepts/queues.rst | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/source/concepts/queues.rst b/source/concepts/queues.rst
+index eb394e8..c71413c 100644
+--- a/source/concepts/queues.rst
++++ b/source/concepts/queues.rst
+@@ -153,6 +153,12 @@ can be requested via "*<object>QueueSyncQueueFiles on/off* with the
+ default being off. Activating this option has a performance penalty, so
+ it should not be turned on without reason.
+ 
++If you happen to lose or otherwise need the housekeeping structures and 
++have all yours queue chunks you can use perl script included in rsyslog
++package to generate it. 
++Usage: recover_qi.pl -w *$WorkDirectory* -f QueueFileName -d 8 > QueueFileName.qi
++
++
+ In-Memory Queues
+ ~~~~~~~~~~~~~~~~
+ 
diff --git a/SPECS/rsyslog.spec b/SPECS/rsyslog.spec
index ebb4a6c..9b4df2f 100644
--- a/SPECS/rsyslog.spec
+++ b/SPECS/rsyslog.spec
@@ -14,9 +14,10 @@
 Summary: Enhanced system logging and kernel message trapping daemon
 Name: rsyslog
 Version: 8.24.0
-Release: 12%{?dist}
+Release: 16%{?dist}
 License: (GPLv3+ and ASL 2.0)
 Group: System Environment/Daemons
+ExcludeArch: i686 ppc s390
 URL: http://www.rsyslog.com/
 Source0: http://www.rsyslog.com/files/download/rsyslog/%{name}-%{version}.tar.gz
 Source1: http://www.rsyslog.com/files/download/rsyslog/%{name}-doc-%{version}.tar.gz
@@ -34,6 +35,7 @@ BuildRequires: libestr-devel >= 0.1.9
 BuildRequires: libuuid-devel
 BuildRequires: pkgconfig
 BuildRequires: python-docutils
+BuildRequires: python-sphinx
 # it depens on rhbz#1419228
 BuildRequires: systemd-devel >= 219-39
 BuildRequires: zlib-devel
@@ -51,7 +53,7 @@ Obsoletes: sysklogd < 1.5-11
 # tweak the upstream service file to honour configuration from /etc/sysconfig/rsyslog
 Patch0: rsyslog-8.24.0-sd-service.patch
 Patch1: rsyslog-8.24.0-msg_c_nonoverwrite_merge.patch
-Patch2: rsyslog-8.24.0-rhbz1188503-imjournal-default-tag.patch
+#Patch2: rsyslog-8.24.0-rhbz1188503-imjournal-default-tag.patch
 
 Patch3: rsyslog-8.24.0-rhbz1303617-imfile-wildcards.patch
 Patch4: rsyslog-8.24.0-doc-polling-by-default.patch
@@ -61,7 +63,7 @@ Patch7: rsyslog-8.24.0-rhbz1401870-watermark.patch
 
 Patch8: rsyslog-8.24.0-rhbz1403831-missing-cmd-line-switches.patch
 Patch9: rsyslog-8.24.0-rhbz1245194-imjournal-ste-file.patch
-Patch10: rsyslog-8.24.0-rhbz1286707-recover_qi-doc.patch
+Patch10: rsyslog-8.24.0-rhbz1507028-recover_qi-doc.patch
 Patch11: rsyslog-8.24.0-rhbz1088021-systemd-time-backwards.patch
 Patch12: rsyslog-8.24.0-rhbz1403907-imudp-deprecated-parameter.patch
 Patch13: rsyslog-8.24.0-rhbz1196230-ratelimit-add-source.patch
@@ -78,6 +80,13 @@ Patch21: rsyslog-8.24.0-rhbz1431616-pmrfc3164sd-backport.patch
 
 Patch22: rsyslog-8.24.0-rhbz1056548-getaddrinfo.patch
 
+Patch23: rsyslog-8.24.0-rhbz1401456-sd-service-network.patch
+Patch24: rsyslog-8.24.0-rhbz1459896-queues-defaults-doc.patch
+Patch25: rsyslog-8.24.0-rhbz1497985-journal-reloaded-message.patch
+Patch26: rsyslog-8.24.0-rhbz1462160-set.statement-crash.patch
+Patch27: rsyslog-8.24.0-rhbz1488186-fixed-nullptr-check.patch
+Patch28: rsyslog-8.24.0-rhbz1505103-omrelp-rebindinterval.patch
+
 %package crypto
 Summary: Encryption support
 Group: System Environment/Daemons
@@ -87,6 +96,8 @@ BuildRequires: libgcrypt-devel
 %package doc
 Summary: HTML Documentation for rsyslog
 Group: Documentation
+#no reason to have arched documentation
+BuildArch: noarch
 
 %package elasticsearch
 Summary: ElasticSearch output module for rsyslog
@@ -279,7 +290,14 @@ of source ports.
 %prep
 # set up rsyslog-doc sources
 %setup -q -a 1 -T -c
+%patch4 -p1 
 %patch10 -p1
+%patch24 -p1
+#regenerate the docs
+mv build/searchindex.js searchindex_backup.js
+sphinx-build -b html source build
+#clean up
+mv searchindex_backup.js build/searchindex.js
 rm -r LICENSE README.md build.sh source build/objects.inv
 mv build doc
 
@@ -288,9 +306,9 @@ mv build doc
 
 %patch0 -p1 -b .service
 %patch1 -p1 -b .msg_merge
-%patch2 -p1 -b .default_tag
+#%patch2 is obsoleted by patch25
 %patch3 -p1 -b .wildcards
-%patch4 -p1 -b .doc-polling
+#%patch4 is applied right after doc setup 
 
 %patch5 -p1 -b .flushontxend
 %patch6 -p1 -b .tls-config
@@ -298,7 +316,7 @@ mv build doc
 
 %patch8 -p1 -b .missg-cmd-line-switches
 %patch9 -p1 -b .ste-file
-#%%patch10 is applied right after doc setup 
+#%patch10 is applied right after doc setup 
 %patch11 -p1 -b .systemd-time
 %patch12 -p1 -b .imudp-deprecated-parameter
 %patch13 -p1 -b .ratelimit-add-source
@@ -313,6 +331,13 @@ mv build doc
 %patch21 -p1 -b .pmrfc3164sd
 %patch22 -p1 -b .getaddrinfo
 
+%patch23 -p1 -b .sd-service-network
+#%%patch24 is applied right after doc setup
+%patch25 -p1 -b .journal-reloaded
+%patch26 -p1 -b .set-statement-crash
+%patch27 -p1 -b .nullptr-check
+%patch28 -p1 -b .rebindinterval
+
 autoreconf 
 
 %build
@@ -562,8 +587,41 @@ done
 %{_libdir}/rsyslog/omudpspoof.so
 
 %changelog
+* Thu Nov 09 2017 Jiri Vymazal <jvymazal@redhat.com> - 8.24.0-16
+RHEL 7.5 ERRATUM
+- edited the patch to conform to latest upstream doc
+  resolves: rhbz#1459896 (failedQA)
+- disabled 32-bit builds on all arches as they are not shipped
+  anymore in RHEL7
+
+* Tue Oct 31 2017 Jiri Vymazal <jvymazal@redhat.com> - 8.24.0-15
+RHEL 7.5 ERRATUM
+- made rsyslog-doc noarch and fixed search on doc regeneration
+  resolves: rhbz#1507028
+
+* Tue Oct 31 2017 Jiri Vymazal <jvymazal@redhat.com> - 8.24.0-14
+RHEL 7.5 ERRATUM
+- renamed patch for undocumented recover_qi script to correct bz number
+  resolves: rhbz#1507028
+- added patch ensuring relp conneciton is active before closing it
+  resolves: rhbz#1505103
+
+* Mon Oct 09 2017 Jiri Vymazal <jvymazal@redhat.com> - 8.24.0-13
+RHEL 7.5 ERRATUM
+- added patch to properly resolve FQDN
+  resolves: rhbz#1401456
+- added documentation patch correcting qeues default values
+  resolves: rhbz#1459896
+- added patch adjusting log level of journal reloaded msg
+  resolves: rhbz#1497985 
+- added patch to prevent crash with invalid set statement
+  this also obsoletes patch2 (for 1188503) 
+  resolves: rhbz#1462160
+- added patch with nullptr check to prevent ABRT
+  resolves: rhbz#1488186
+
 * Wed May 10 2017 Radovan Sroka <rsroka@redhat.com> - 8.24.0-12
-- added BuildRequires for systemd >= 219-39 depents on rhbz#1419228
+- added BuildRequires for systemd >= 219-39 depends on rhbz#1419228
 
 * Tue May 09 2017 Radovan Sroka <rsroka@redhat.com> - 8.24.0-11
 RHEL 7.4 ERRATUM