----------------------------------------------------------------------------------------
Scheduled Release 8.2506.0 (aka 2025.06) 2025-06-10
- 2025-06-10: core fix: hastable object did not init memory properly on extend
  When a hash table was expanded, the newly allocated memory segment was not
  cleared correctly. This was caused by providing an incorrect destination
  address and byte-count to the memory-clearing function.
  This could lead to instability or incorrect behavior when the hash table
  grew. The new memory is now properly zero-initialized, ensuring stable
  operation.
- 2025-06-10: queue fix: spammy queue size message do to incorrect commit
  Reverted commit 525a6f1bbf that tried to provide better diagnostics for
  queues being potentially misconfigured that was invalid and created queue warning
  messages on startup.  The functionality will be re-implemented properly later.
  JThis is no loss of
  functionality.
- 2025-06-10: CI: new python-based codestyle checker
  Easier to maintain than the off-project C source. The checks
  are pretty trivial.
  closes https://github.com/rsyslog/rsyslog/issues/5631
- 2025-06-09: omfwd regression fix: avoid false active target change log message
  Commit ffaf6dc added proper variable sync, but dropped the check
  if active count had actually changed. As such, the output was always
  generated, which could pollute the log heavily.
- 2025-06-09: imuxsock: Add statistics counter for discarded messages
  This patch introduces a counter to track the number of discarded messages.
  Additionally, it fixes a bug where the submitted message count was incremented
  even when the message was discarded due to exceeding the allowed message rate
  within a given interval.
  Thanks to Attila Lakatos for the patch.
- 2025-06-08: lookup tables: add new table type for regex-matches
  While we do not like rexeg-matches for performance reasons, they are
  well known and appreciated by users. With the new table type, we
  add a lookup capability for partial matches, but at the price
  of much higher ressource use. It still is useful, e.g. to classify
  events as "noise" events in a simple manner.
- 2025-06-08: docs: restructure contributor docs for clarity and AI agent readiness
  This updated all contributor-facing documentation:
  - **README.md**: Modernized structure; clarified installation/build.
    Removed obsolete local doc references, linked to rsyslog-doc.
  - **CONTRIBUTING.md**: Refactored for clarity; added AI code guidance
    (e.g., commit prefix `AI:`). Formalized draft PRs for experiments.
    Removed outdated "testing new releases" advice. Added rationale
    for `master` branch due to ecosystem dependencies.
  - **AGENTS.md** (new): Introduces clear guidelines for AI agents
    contributing to rsyslog. Includes commit formatting, PR branch
    expectations, testing environment, and behavioral rules.
  **Why now?**
  Over two years, we've evaluated evolving AI dev agent capabilities.
  We now consider them mature enough for rsyslog dev workflow—under
  careful human review. This update provides the foundation to onboard
  agents in a controlled, auditable, high-quality manner.
  All changes prioritize traceability and developer clarity—both human
  and AI.
  closes: https://github.com/rsyslog/rsyslog/issues/5657
- 2025-06-08: improved CI workflow
- 2025-06-08: omazureeventhubs bugfix: wrong content-type used
  This was detected during a code review. No report from practice is known. There was
  a type in the content type definition when encoding the message. This can potentially
  lead to malfunction.
- 2025-06-06: omusrmsg: fixed a potentially unsafe string builder
  While not expected to be problematic in practice, there still was some security
  issue potential AND it prevented clean build in some environments.
- 2025-06-05: impstats: add prometheus format to set of supported output formats
  This can be used eg. to use node_exporter file scraping capability
- 2025-06-04: omsendertrack: new module
  The omsendertrack module is designed to track and report statistics for
  message senders across all inputs in Rsyslog. It periodically outputs a
  JSON file containing information about each sender.
  Note: This commit provides minimalistic basic functionality as a PoC.
  We will check it's usefulness in practice and expect follow-up PRs
  to enhance functionality and include feedback from early testing.
  However, this module is solid, just feature limited.
  see also: https://github.com/rsyslog/rsyslog/issues/5599
- 2025-05-29: omjournal: Fix priority value
  Thanks to Bougrine Anis for the patch.
- 2025-05-14: tls subsystem: generate better error message on accept failure
  Right now, the remote peer is not reported, even in cases where
  this would be possible. This patch provides a method to emit a
  second message with remote peer information in cases where it
  is possible. This is the case when the remote peer connects via
  plain tcp but TLS cannot be negotiated, especially because the
  connection breaks immediately. Most probably this behaviour can
  be created by load balancer and other tools healt checks.
  This patch improves debugging network issues. So it is useful.
----------------------------------------------------------------------------------------
Scheduled Release 8.2504.0 (aka 2025.04) 2025-04-29
- 2025-04-25: ossl tls driver: better error reporting
  Replace some generic error codes with more specific counterparts.
  There is still some more work to do, but this covers important
  spots.
- 2025-04-25: gnutls netstrm drvr fix: handle write retry correctly in recv call
  When receiving, gnutls internally may need to write (e.g. for session key
  changes), so we need to support that. This is a long-standing issue
  that can have caused invalid error message and session closure.
  The erorr message was:
  GnuTLS receive error <nbr> has wrong read direction(wants write) -
  this could be caused by a broken connection. GnuTLS reports: <text>
- 2025-04-25: tcpsrv bugfix: do not busy wait on io events
  Depending on circumstances, tcpsrv worker threads did effectively
  busy-wait on io events to handle. Not always, but often. This was
  caused be improperly re-arming the inotify subsystem.
  This effected overall system performance, but not general rsyslog
  stability. The bug was introduced on March 1st 2025 into the
  daily stable build.
  closes: https://github.com/rsyslog/rsyslog/issues/5623
- 2025-04-23:  tcpsrv: add experimental stats
  This is a stats for worker awaking via event notification. Could be useful
  under some cirumstances. it's called "emptyReads".
  It needs to be decided if this is a useful setting or not.
- 2025-04-16: tcpsrv bugfix: input name was not properly propagated
  As a result, it did not show up in pstats. Alos, we now use the input name
  in worker thread to easily identify where they belong to. As thread names
  have very limited length, the thread naming now is
  "w<worker-number>/<input-name>".
  Note: this bug was introduced 2025-03-01 (daily stable build)
- 2025-03-06: rsyslog core fix: buffer overflow when the argument to replace() is empty
  This fixes the following situation:
  We have these expressions in rsyslogd.conf:
      set $!rsyslog_FileFormat = exec_template("RSYSLOG_FileFormat")
      set $!localheader = re_extract($!rsyslog_FileFormat, "[^ ]+.* +port[0-9]", 0, 0, "");
      set $!localpattern = re_extract($!rsyslog_FileFormat, " [^ ]+ +[^ ]+ +port[0-9]", 0, 0, "");
      set $!localheader = replace($!localheader, $!localpattern, " ");
  We have a message like this arriving.
      <30>Feb 24 22:08:21 hostname port03 'label' RXDATA: \n
  It was observed that when 2 of these messages arrive in a row, rsyslogd
  crashes. This is clearly due to memory corruption, as the crash comes
  from within calloc.
  Thanks to Lincoln Ramsay for the patch.
- 2025-03-05: several small to cosmetic leak fixes based on Coverity Scan
- 2025-03-04: perctile_stats: do not use uninitialized values on error
  Thanks to Attila Lakatos for the patch.
- 2025-03-04: omfwd bufgix: potential segfault in UDP forwarding
  A segfault could occur if the configured port could not be bound to the interface.
  Thanks to Markel Azpeitia Loiti for the patch.
- 2025-03-01: imtcp: major multithreading and performance improvements
  This commit significantly enhances imtcp by introducing a fully
  functional worker thread pool, enabling true multi-threaded
  processing for better scalability under high loads. This is
  particularly beneficial when using TLS connections.
  
  Notable changes:
  - Implemented a complete worker pool for imtcp.
  - Introduced the `workerthreads` config parameter for tuning
    concurrency.
  - Improved epoll efficiency by enabling edge-triggered mode.
  - Added starvation handling via `starvationProtection.maxReads`.
  - Refactored session accept logic and optimized network object
    handling.
  - Removed an obsolete network driver layer for event notification.
  - Fixed multiple issues related to message timing, EPOLLERR
    handling, and tests.
  - Improved performance in poll() mode by reducing redundant
    allocations.
  - Introduced new CI tests for imtcp without epoll.
  - Allowed disabling imtcp tests via a new configure switch.
  - Added new impstats counters for worker thread pool statistics.
 
  Details:
  - The worker pool replaces an outdated experimental
    implementation.
  - If `workerthreads=1`, no worker pool is created to minimize
    context switches.
  - Moves worker pool variables inside `tcpsrv` instance to
    prevent conflicts.
  - Extracts session `accept()` logic into a dedicated function
    for clarity.
  - Fixes message ordering inconsistencies in multi-threaded
    scenarios.
  - Properly handles `EPOLLERR` notifications to improve error
    resilience.
  - Optimizes poll() mode by avoiding unnecessary reallocation
    of file descriptors.
  - Replaces the old network driver layer for event notification
    with a streamlined solution.
    - Now uses **conditional compilation** to select the best
      method (epoll or poll) at build time.
    - This significantly reduces code complexity, improves
      maintainability, and boosts performance.
  - The previous "thread pool" was a rough experiment that did
    not perform significantly better than single-threaded mode.
    - The **new implementation** allows multiple worker threads
      on platforms with `epoll`.
    - On non-epoll systems, an optimized **poll() based
      single-threaded approach** is used, which is expected to
      perform better than the old "thread pool."
  - Adds `pthread_setname_np` only when available to improve
    portability.
  - Fixes test cases that assumed strict message timing, which
    was unreliable.
  - Reduces test parallelism for TSAN CI runs to prevent
    resource exhaustion.
  - Moves a test case to `imdiag` to ensure stable execution.
  - Provides a new CI environment to verify `imtcp` behavior
    without epoll.
  - Introduces `--enable-imtcp-tests` configure switch for test
    flexibility.
  - Improves debug logging and adds better error handling for
    worker pool startup.
  
  New configuration parameters:
  - `workerthreads`: Defines the number of worker threads for
    imtcp. If set to 1, no worker pool is created.
  - `starvationProtection.maxReads`: Defines the maximum number
    of consecutive reads a worker can perform before being
    interrupted to allow other sessions to be processed.
  
  New impstats counters (emitted only when `workerthreads > 1`):
  - `runs`: Number of times the worker thread has been invoked.
  - `read`: Number of read calls performed by the worker.
    For TLS, this includes read/write calls.
  - `accept`: Number of `accept()` calls handled by the worker.
  - `starvation_protect`: Number of times a socket was sent
    back to the queue due to reaching the maximum number of
    consecutive requests, ensuring fair scheduling of sessions.
  
  These changes significantly enhance rsyslog’s TCP handling
  performance and stability, particularly in high-volume
  environments.
  
  Closes #5529, #5532, #5578, #5580.
- 2025-03-01: "fixed" clang static analyzer false positives
- 2025-03-01: fixed clang static analyzer detected very unlikely but possible bugs
----------------------------------------------------------------------------------------
Scheduled Release 8.2502.0 (aka 2025.02) 2025-02-18
- 2025-02-16: gnutls bugfix: Avoid blocking sockets during TLS handshake
  When forwarding logs to a TLS server, using a blocking socket
  can lead to indefinite waiting during the gnutls_handshake()
  call if the server does not respond as expected.
  This commit modifies the behavior to use non-blocking sockets,
  ensuring that the rsyslog client does not hang indefinitely
  waiting for a response.
  Thanks to Attila Lakatos for the patch.
- 2025-02-13: CI: add compile check with atomic operations disabled
  The platforms that do not have support for atomic operations become
  more and more exoctic. Even more so, only Solaris builders now test
  that inside the rsyslog CI. To "harden" the CI system against a
  potential (temporary) unavailability of Solaris, we now also do
  a build where we intentionally disable atomics. This will trigger
  build issues on all platforms. This method also permits us to detect
  problems quicker, as the solaris builders are slow.
- 2025-02-13: omfwd bugfix: variable was not properly synced across threads
  While this could lead to some inefficiency, it should not have caused
  any real harm. But with data races it is never sure if more severe
  issues occur. However, here only very strange use cases can be
  envisioned where this might be the case.
  In any case, the issue is now solved.
  This also fixes some TSAN CI "flakes".
- 2025-02-12: testbench: prevent flake by better sync of snmp test tool startup
  In order to prevent flakes on some environments, we have enhanced the SNMP trap
  receiver testing tool so that it indicates successful startup via a pid file, which
  now can be used to hold rsyslog start until the test tool is fully up and running.
- 2025-02-12: CI: add Testruns under Ubuntu 24.04
  Note: we temporarily disable omamqp1 testing while we search for
  the missing dependency.
  We also add a special setting that permits us to control if
  known-(very)-flaky test shall be run.
  closes https://github.com/rsyslog/rsyslog/issues/5546
- 2025-02-11: testbench: Add new version of snmptrapreceiver.py for python 3.11+
  The system packages on Ubuntu 24 appear to be broken for python3-pysnmp4.
  And when we update the package using
          pip install pyasn1 pysnmp --break-system-packages --upgrade
  We need adapt the code, so a new version snmptrapreceiverv2.py
  has been added which will automatically been chosen if Python is >3.10
  closes: https://github.com/rsyslog/rsyslog/issues/5554
- 2025-02-10: ossl netstream driver: allow ephemeral Diffie-Hellman key exchange
  Use well known DH parameters that have built-in support in OpenSSL.
  From the man page: If "auto" DH parameters are switched on then
  the parameters will be selected to be consistent with the size of
  the key associated with the server's certificate.  If there is no
  certificate (e.g. for PSK ciphersuites), then it it will be
  consistent with the size of the negotiated symmetric cipher key.
  Thanks to Attila Lakatos for the patch.
- 2025-01-28: testbench: reduce flakiness for omhttp-batch-retry-metadata.sh test
  The test results were not deterministic. Sometimes it passed, sometimes
  it failed. The omhttp-validate-response.py script tried to parse the
  json input line by line, but sometimes the message and response fields
  are on separate lines, thus it failed to parse. This is the case
  for both files used to control the checking.
  This patch updates the check program so that it reads in complete
  lines when parsing fails, thus removing this condition for flakiness.
  HOWEVER, after doing so the test still sometimes fails. This may
  point into a problem with the contributed omhttp module. Unfortunately,
  I do not have enough insight into that module (nor time) to try to
  address the root cause.
  closes https://github.com/rsyslog/rsyslog/issues/5439
- 2025-01-27: testbench fix: OpenSSL 3.x depreceated warnings in tcpflood
- 2025-01-27: omfwd: align some parameters with imtcp names
  Parameter names have historically evolved and are sometimes
  inconsistent between modules (while still having the same
  semantics and similiar name).
  This commit creates three aliases in omfwd to keep stream
  driver parameter names consistent with the names used in
  imtcp. Note that we do not create an alias for
  "streamdriverpermittedpeers" because the name differ more
  considerably and we would also need to create an alias
  in imtcp as well. We will do this only on request.
  Note: aliases help, but are not a great solution. They may
  cause confusion if both names are used together in a single
  config. So care must be taken when using an alias.
- 2025-01-27: testbench: remove ElasticSearch 6.0 based tests
  EleasticSearch 6 is heavily outdated. Testing against that
  platform is no longer needed.
- 2025-01-27: omsnmp: replaced inet_aton with inet_pton for IPv4 address conversion
  inet_pton is part of POSIX, whilst inet_aton is not. Moreover the
  function is marked as forbidden according to rpmlint:
  Forbidden function symbols found: inet_aton
  Thanks to Attila Lakatos for the patch.
- 2025-01-27: tcpflood test tool: enable multi threaded connection open
  Connections were originally opened sequentially. This commit adds the
  capability to open them via multiple threads in parallel.
  This is needed at least for cases where we need to test multiple
  pending connection requests, which can be accepted with an
  "accept() loop".
  It can also be useful for speeding up parts of the testbench.
  However, the additional concurrency makes it potentially harder
  to debug if bugs are detected. So tests may use multiple threads
  for connect during regular operations but should also offer the
  option (by editing) to revert to a single thread for easier
  debugging.
  closes https://github.com/rsyslog/rsyslog/issues/5535
- 2025-01-23: imtcp: add "socketBacklog" parameter to configure TCP backlog size
  A new "socketBacklog" parameter has been added to the imtcp module, allowing
  users to override the default TCP SYN backlog size. Previously, the backlog
  was set to roughly 10% of the configured max sessions, which remains the
  default if the parameter is not specified. This enhancement enables better
  configuration for high-performance servers. The parameter name aligns with
  the "socketBacklog" parameter in imptcp for consistency.
  The "socketBacklog" parameter should be set based on the anticipated connection
  rate and the server's ability to handle incoming connections. For high-performance
  environments with heavy traffic, a larger value may be needed to avoid dropped
  connections during bursts. If unsure, leave the parameter unset to use the default
    (10% of max sessions), which is suitable for typical workloads.
- 2025-01-23: testbench: add new and adapt imtcp tests for large connection counts
  Updated the imtcp test suite to set the "SocketBacklog" parameter to a higher
  value to accommodate tests with a large number of concurrent connections.
  This change addresses potential CI flakes caused by SYN queue overflows during
  test runs and significantly reduces test runtime by avoiding delays during
  session setup.
  The adjusted SocketBacklog parameter ensures smoother handling of high
  connection counts, improving test reliability and performance.
- 2025-01-23: imptcp: Increase default SYN backlog for imptcp server to 64
  Increased the default TCP SYN backlog for the imptcp server from 5 to 64 to
  address potential connection instability and performance issues under high
  connection load scenarios. The previous default of 5 was too low for many
  workloads, particularly in scenarios involving a rapid influx of client
  connections. This could lead to SYN queue overflow, delayed connection
  establishment, and eventual RSTs or retransmissions during subsequent phases
  of the connection lifecycle.
  The new default of 64 provides better handling of typical workloads while
  allowing further customization via the "SocketBacklog" configuration option.
  Note: The "SocketBacklog" configuration option can be adjusted to handle
  specific workloads such as high rates of concurrent connection openings, burst
  traffic, or other resource-intensive scenarios.
- 2025-01-23: testbench: adapt imptcp tests for large connection counts
  Updated the imptcp test suite to set the "SocketBacklog" parameter to a higher
  value to accommodate tests with a large number of concurrent connections.
  This change addresses potential CI flakes caused by SYN queue overflows during
  test runs and significantly reduces test runtime by avoiding delays during
  session setup.
  The adjusted SocketBacklog parameter ensures smoother handling of high
  connection counts, improving test reliability and performance.
- 2025-01-16: netstrm TLS driver: move TLS retry handling to main driver
  This simplifies the driver interface. It is also kind of prep-work
  for implementing real multi-threading support for imtcp (to be done
  in a separate set of commits).
  see also https://github.com/rsyslog/rsyslog/issues/5532
- 2024-12-31: build: support for compile with -std=gnu23 gcc option
  Note: The upcoming gnu23 C standard is overdoing it with type-safety. Inside
  rsyslog, we historically have method tables for generic calls, which
  keeps the code small and easy to understand. This would not decently be
  possible with the new type-safety requirements.
  So this commit works around these warning in a way that pretends to
  provide more type safety. We have done this in the least intrusive
  way to reduce the risk for regressions in code that works well in
  since decades. Also note that the code already does parameter
  validation.
  There would have been more elaborate ways to make gnu23 compile happy,
  e.g. by using a union of structs to provide the data element. Some folks
  consider this type safe. In reality, it is not a bit better than
  traditional C without types at all. Because the caller still needs to
  ensure it picks the right struct from the union. As this approach
  would also have larger regeression potential, we have not used it.
  Right now, we have suppressed some of the new warnings, as working
  around them would have required an even larger time budget and
  potentially larger regression potential. In the long term we may
  want to look into enabling them, as they would potentially be
  beneficial for new code not involving method tables.
  Some nits, however, were detected and have been fixed.
- 2024-12-04: omazureeventhubs bugfix: URL escaping
  Some characters were not properly escaped, leading to malfunction on submission.
----------------------------------------------------------------------------------------
Scheduled Release 8.2412.0 (aka 2024.12) 2024-12-03
- 2024-12-02: rainerscript bugfix: do not try to call a function if it does not exist
  This could previously cause a segfault when the function was called.
  Thanks to Attila Lakatos for the patch.
- 2024-12-02: Fix legacy $ActionQueueDiscardMark parameter
  If the $ActionQueueSize legacy parameter was configured
  with a much value higher than the default, the queueDiscardMark
  option was not automatically adjusted to represent 98% of
  the actual queue size. This caused a misalignment issue,
  which does not occur when using the RainerScript syntax.
  Thanks to Attila Lakatos for the patch.
  Note: We usually do NOT change legacy parameters, but in this case it makes
  sense to adjust to recent developments.
- 2024-11-25: improvements in CI system
  added some support for Ubuntu 24.04 - stil more work to do
- 2024-11-25: small nitfixes
  mostly to address nits detected by newer compilers due to CI-system modernization
- 2024-11-19: core bugfix: potential stability issue with corrupt queue file resolved
  Thanks to Flos Lonicerae for the patch.
- 2024-11-19: core bugfix: prevent segfault on use of $ControlCharacterEscapePrefix
  When this obsolete legacy directive was used, rsyslog most probably segfaulted during
  startup. This did not affect it's modern counterpart.
  Thanks to Flos Lonicerae for the patch.
- 2024-11-14: core bugfix: rsyslog could segfault if immediately stopped during startup
  systemd restart rsyslog in the early start of OS will let rsyslog segmentation
  fault. This cmd will send sigTerm to rsylogd, and rsyslogd will handle the
  signal in rsyslogdDoDie. If the rsyslogd havn't parse the conf, the runConf
  will be NULL So check the pointer before reference it.
  see also: https://github.com/rsyslog/rsyslog/issues/5453
  thanks to Wang Haitao for the patch.
- 2024-11-14: imhiredis cleanup: fix incorrect variable definitions and missing prototype
  Thanks to Théo Bertin for the patch.
- 2024-11-14: config processing bugfix: typo and missing space when file can't be accessed
  When using the backtick feature with cat and a file that does not exist,
  an error message is placed where the file content would be. This error
  message contained a typo in could as well as a missing space between
  see and error, which have now been fixed.
  Thanks to Tobias Kantusch for the patch.
- 2024-11-14: build fix: resolved issue when building on musl
  Thanks to Quincy Fleming for the patch.
- 2024-11-14: testbench bugfix: typo caused invalid test file to be used
  ... which went unnoticed during regular make check runs, but lead to
  "left-over files after distclean" after make distcheck.
  This could also potentially be responsible for some flakes that were
  not fully explainable.
- 2024-11-14: nsd_ptcp regression fix: remove debugging messages emited to stderr
  fix regression introduced by 9ac56b286. This spits out a debug message
  to stderr. That message is removed by this patch here.
  closes https://github.com/rsyslog/rsyslog/issues/5485
----------------------------------------------------------------------------------------
Scheduled Release 8.2410.0 (aka 2024.10) 2024-10-22
- network subsystem: improve connection failure error message
  If we try to connect via TCP and the connections fails, we now
  tell inside the error message how long the connection attempt
  took. This is useful to find out if targets connect very
  slowly.
- regression fix: build issue on Solaris 10
  Solaris 10 does not support SO_REUSEPORT, which we need for some
  tests. It is used in minitcpsrvr.c, and will now not be used if
  not available.
  Note that tests requiring that option will also need to be disabled
  for that platform.
  commit which introduced regression: 1c0f9bb
- testbench: correctly apply socket options in minitcpsrvr
  The option name in setsockopts is not a bitmask, so SO_REUSEADDR and
  SO_REUSEPORT can't be ORed together. Instead apply the options via
  separate calls.
  Fixes: #5456
  Thanks: Chris Hofstaedtler <zeha@debian.org> and Michael Biebl
----------------------------------------------------------------------------------------
Scheduled Release 8.2408.0 (aka 2024.08) 2024-08-20
- 2024-08-16: omfwd: implement native load balancing - phase 1
  This patch implements a simple round-robin load balancer
  for omfwd. It provides equal distribution of load to a pool
  of target servers.
  The code currently has no different modes and no special tuning
  for the load balancer. However, it works very well in the most
  common use cases. Furthermore, it provides a solid base on which
  more elaborate functionality can be build if there is need to.
  The new functionality is fully backwards compatible with previous
  configuration settings.
  New action() config params:
  * pool.resumeinterval
  New/"changed" rstats counters
  Each target receives its own set of pstats counters. Most
  importantly this is the case for byte counts. That counter retains
  the same naming, but there may now be multiple of these counters,
  one for each target ip, port tuple.
  New pstats message count to target
  Among others, this can be used for checking that the load balancer
  works as intended. The so-far byte count emitted does not provide
  a clear indication of how many messages the targets had actually
  processed.
  For obvious reasons, this message count makes most sense in
  advanced load balancing scenarios, but also provides additional
  insight into round-robin. Non-matches indicate that targets
  went offline, and we can now evaluate the impact this had
  on processing.
  - re-design rebind functionality
  This now works at the transaction level. It causes a rebind of all
  pool members. Previous code did not work 100% correct since for a
  couple of years now (after output batching integration).
  As cleanup, rebindInterval support has been removed from tcpClt,
  because omfwd is the only user. This permits a cleaner code path.
  We also noticed a bug with rebindInterval:  it caused some mild
  message duplication for quite some time. This went unnoticed.
  To address that efficiently, rebindInterval in the future will
  be considered once per batch. That means up to (maxBatchSize - 1)
  messages may be transmitted more than the rebindinterval is.
  That's the cleanest mode of operation and should not make any
  difference for real deployments.
  Some additional work done in this commit:
  - netstream: harden component against upper-layer logic errors
  - network subsystem: better handle API errors and provide more info
  - omfwd: add new parameter "iobuffer.maxsize"
  - add new global parameter debug.abortoninternalerror and use it
  - This parameter permits to make test runs fail when an internal error
  - is detected and gracefully handled by rsyslog. While it is great to
    have it gracefully handled in practice, we should not accept this
    during testing. The new parameter permits to abort in this case and
    emits the related error message beforehand. It is turned on by
    default in our regular tests.
  - add dedicated error code for "hard" program errors
  - omfwd: some cleanup + error message fix + new debug level messages
  - imptcp: improve error messages
  - add omfwd option to NOT do extended connection check
  - also output wrkr id in some omfwd messages (primarily debugging aid)
  - better debug info via LogMsg() interface
  - improve messages regarding imptcp and omfwd suspension / thread IDs
  - refactor and enchance minitcpsrvr for mimicing died servers
  - new global (debugging) option, correction of an informational msg
  - add global option allmessagestostderr
  - add new tests
- 2024-08-16: omkafka enhance: write Kafka log with level ERROR or higher into errorfile
  closes: https://github.com/rsyslog/rsyslog/issues/5425
- 2024-08-16: net subsusytem bugfix: some config statemens were not accepted
  The following parameters were not always excepted, even though they were documented
  and the supporting code was also present. This has been corrected:
  * streamdriver.cafile
  * streamdriver.crlfile
  * streamdriver.keyfile
  * streamdriver.certfile
  Thanks to Qiumiao Zhang for the fix.
- 2024-08-13: new "ossl" crypto provider
  Thanks to Attila Lakatos for the patch.
- 2024-08-05: imtcp: improve connection error messages
  They now contain remote peer information whereever possible.
----------------------------------------------------------------------------------------
Scheduled Release 8.2406.0 (aka 2024.06) 2024-07-02
- 2024-07-01: ompgsql bugfix: unexpected and unnecessary message loss
  In case of PG not available lets retry instead of dropping messages
  Thanks to Nickolai Novik for the patch.
- 2024-07-01: tls subsystem/ossl driver
  Several small fixes/additions
  * output all loaded ciphers and engines into debug log
  * Add new global option "defaultopensslengine" to customize the default openssl
    engine. If not defined, openssl will handle the default engine automatically.
    Sample: global(defaultopensslengine="rdrand")
  * Add simple openssl performance test (imtcp-tls-ossl-basic-stress.sh) with
    defaultopensslengine set to rdrand (Intel).
  * removed unneeded testcase files in runtime folder.
- 2024-04-18: [o|i]mprog/mmexternal bugfix: invalid command line parameter passing
  Quoted command line parameters were incorrectly passed to the called program. This
  resulted in unexpected behaviour. For example, in
  bash -c "echo test"
  bash got passed parameters '-c" and '"echo test"'. Note the double quotes in
  '"echo test"'. These needed to be removed by Unix/Linux standards but were instead
  passed to bash. That in turn resulted in invalid execution. With the fix, the
  behaviour is now correct. Now, bash gets passed '-c' and 'echo test'.
  This actually is a BREAKING CHANGE. However, it was outright wrong behaviour from
  the beginning. We assume that people either never noticed it (because they did not
  use quoted parameters) or used some workaroud, likely a "starter script", which
  performed the right task. As such, we do expect that only a very limited set of
  installations might be affected by the change.
  Even more important, we would need to change the default behaviour in any case,
  because the previous handling was obviosuly unacceptable. As such, there was no
  way to keep rsyslog perform the previous action.
  Thanks to Paul Fertser for the patch.
- 2024-04-12: bugfixes related to time_t on 32 bit platforms (y38k isue)
  Thanks to Michael Biebl for the patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2404.0 (aka 2024.04) 2024-04-02
- 2024-04-02: omhttp patches and enhancement
  New omhttp plugin configuration parameters added:
  * restpathtimeout - configures a timeout value for an omhttp restpath, and retry again
  * httpretrycodes (list) - configurable list of HTTP status codes that should be
    retried by omhttp plugin. The default behavior is to retry any non 2xx status code.
  * httpignorablecodes (list) that can specify HTTP status codes that should be ignored
    (as failures). status codes specified as ignorable code will not be retried.
  * proxyhost, proxyport - configures a proxy, for which omhttp can use to set up a 
    HTTP proxy tunnel connection. Also works by reading environment variable if
    configured HTTP_PROXY. For more details see libcurl docs on CURLOPT_PROXY
    thanks to @erenwh for the contribution!
  * retry.addmetadata - when this option is enabled, omhttp will add the
    response metadata to: $!omhttp!response. There are 3 response metadata added:
    code, body, batch_index.
  More statistics omhttp curl statistic counters:
  * requests.count
  * requests.status.0xx
  * requests.status.1xx
  * requests.status.2xx
  * requests.status.3xx
  * requests.status.4xx
  * requests.status.5xx
  * requests.bytes
  * requests.time_ms
  No longer discard 3xx, 4xx errors
  see also https://github.com/rsyslog/rsyslog/issues/4636
  Thanks to github user n2yen for the patches.
- 2024-04-02: remove CAP_IPC_LOCK capability
  Does not seem to be necessary.
  Thanks to Michael Biebl for the patch.
- 2024-03-28: TLS bugfix: TLS drivers did not properly load under some conditions
  This was a regeression from the DTLS implementation
- 2024-03-28: mmdblookup bugfix: do not suspend on incompatible IP lookup
  Mmdblookup module used to suspend after erroring on an IPv6 IP lookup on IPv4-only
  DBs. The suspension of the module is now replaced by a simple log message,
  allowing it to keep working for future lookups.
  Thanks to Théo Bertin (frikilax) for the patch.
- 2024-03-28: tarball fix: dist tarball was missing a textbench file
  This made the testbench fail.
----------------------------------------------------------------------------------------
Scheduled Release 8.2402.0 (aka 2024.02) 2024-02-27
- 2024-02-26: add DTLS support
  This version comes with the initial implementation of imdtls and omdtls.
  These modules permit secure message exchange over UDP.
- 2024-02-26: testbench: make omusrmsg-noabort test more reliable
  The previous test did not always detect an abort of rsyslog/omusrmsg.
  The detection method has now been improved, so it is far more
  probable that an abort is detected.
  While doing this, we noticed that the omusrmsg-noabort-legacy test was
  now a 100% duplicate. There is no need any longer to check pure legacy
  syntax, and so that test has been removed.
  We also added a valgrind-based test ofr omusrmsg-noabort, which furthers
  strengthens bug detection. Most importantly, it helps us to detect
  potentially new memory leaks on all CI platforms (in case the lib
  behaves differently depending on os/distro).
  see also https://github.com/rsyslog/rsyslog/issues/5294
- 2024-02-26: omusrmsg bugfix: potential double free, which can cause segfault
  omusrmsg frees a string which points to OS/system library memory. When
  the os/libs clean up, it frees the memory as well. This results in a
  double free. This bug interestingly seems to go unnoticed in many cases.
  But it can cause a segfault or hard-to-trace memory corruptions which
  could lead to other problems later on. The outcome of this bug most
  probably depdns on os/library versions.
  closes https://github.com/rsyslog/rsyslog/issues/5294
- 2024-02-26: ommysql bugfix: potential segfault on database error
  Due to an invalid code path, ommysql may cause a segfault if database
  transactions fail into a specific way. The main trigger is a totally
  irrecoverrable database error which can lead to premature connection
  close, which is not checked for in all recover code.
  This was detected in a setting where a stored procedure is called that
  rolls back a transaction in itself.
  This patch fixes the issue.
  closes https://github.com/rsyslog/rsyslog/issues/5288
- 2024-02-26: omfile: do not carry out actual action when writing to /dev/null
  In some use cases omfile is configured to write to /dev/null. This seems
  primarily be done because of statistics gathering but maybe some other
  scenarios. We now add conditional logic to not do any actual omfile
  action when the target file is /dev/null.
  Note: this check only works on static file names. When /dev/null is
  evaluated as part of dynafile, it will be handled just in the regular
  case like before this patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2312.0 (aka 2023.12) 2023-12-12
- 2023-12-11: imjournal: Add new input module parameter 'defaulttag'
  The DefaultTag option specifies the default value for the tag field.
  In imjournal, this can happen when one of the following is missing:
   * identifier string provided by the application (SYSLOG_IDENTIFIER)
   * name of the process the journal entry originates from (_COMM)
  Thanks to Attila Lakatos for the patch.
- 2023-12-08: core bugfix: rsyslog messages may not always have FQDN
  Even if hostname FQDN is configured, rsyslog internal messages generated
  after rsyslog startup and before the first HUP will not necessarily have
  FQDN but instead only the shortname of the local host. This commit
  fixes the situation.
  Special thanks to github user eciii for doing a great bug analysis
  and helping us considerably to fix the issue.
  closes https://github.com/rsyslog/rsyslog/issues/5218
- 2023-12-08: omlibdbi regression fix: database path was not properly used
  Commit 4a072d6c93015a63716c49a6c7756df22750086a caused a regression that made
  the database path unreliable to use. Depending on platform/libc version the
  basename was improperly extracted, which made access to the database of sqllite
  impossible.
  Thanks to Flávio Tapajós for the patch.
  closes: https://github.com/rsyslog/rsyslog/issues/5282
- 2023-12-06: mazureeventhubs: Corrected handling of transport closed failures
  - Added test for connection interrupts (requires root)
  - Corrected handling of PN_TRANSPORT_CLOSED.
  - Make sure Connection is being reestablished trough tryResume
  - Enhanced Debug log output
  closes: https://github.com/rsyslog/rsyslog/issues/5269
- 2023-11-24: imkmsg: add params "readMode" and "expectedBootCompleteSeconds"
  These parameters permit to control when imkmsg reads the full
  kernel log upon startup.
  Parameter "readMode" provides the following options:
    * full-boot - (default) read full klog, but only "immediately" after
      boot. "Immediately" is hereby meant in seconds of system
      uptime given in "expectedBootCompleteSeconds"
    * full-always - read full klog on every rsyslog startup. Most
      probably causes messag duplication
    * new-only - never emit existing kernel log message, read only
      new ones.
  Note that some message loss can happen if rsyslog is stopped
  in "full-boot" and "new-only" read mode. The longer rsyslog is
  inactive, the higher the message loss probability and potential
  number of messages lost. For typical restart scenarios, this
  should be minimal. On HUP, no message loss occurs as rsyslog
  is not actually stopped.
  The default value for "expectedBootCompleteSeconds" is 90.
  see also https://github.com/rsyslog/rsyslog/issues/5161
- 2023-11-10: imkmsg: add module param parseKernelTimestamp
  The parameter permits to select whether or not and when kernel
  timestamps shall parsed, that is be used as the actual time a
  log message occurs.
  This permits to work around problems with the way kernel
  timestamps are represented. The reasoning is given in a sysklogd
  commit by Joachim Wiberg, which we reproduce below ("QUOTE") to
  have a stable reference.
  The commit itself can be found for example at:
  https://github.com/troglobit/sysklogd/commit/9f6fbb3301e571d8af95f8d771469291384e9e95
  The new parameter parseKernelTimestamp has three possible modes:
  "startup" - uses the kernel time stamp during the initial read
  loop of /dev/kmsg, but replaced it later ignores it for later reads.
  This is the DEFAULT setting.
  "on" - kernel timestamps are always used and no correction is tried
  "off" - kernel timestamps are never used, system time is used instead
  Note that there this is a slightly breaking change. Previously, imkmsg
  reported similar to "off" mode, now it reports by default in "startup"
  mode. We consider this acceptable, as "off" mode timestamps are not
  correct for startup. After startup, the behaviour is correct. All in
  all, the new default is kind of a bugfix.
  ============== QUOTE ===============
  The spec[1] says the /dev/kmsg timestamp is a monotonic clock and in
  microseconds.  After a while you realize it's also relative to the boot
  of the system, that fact was probably too obvious to be put in the spec.
  However, what's *not* in the spec, and what takes a while to realize, is
  that this monotonic time is *not* adjusted for suspend/resume cycles ...
  On a frequently used laptop this can manifest itself as follows.  The
  kernel is stuck on Nov 15, and for the life of me I cannot find any to
  adjust for this offset:
      $ dmesg -T |tail -1; date
      [Mon Nov 15 01:42:08 2021] wlan0: Limiting TX power to 23 (23 - 0) dBm as advertised by 18:e8:29:55:b0:62
      Tue 23 Nov 2021 05:20:53 PM CET
  Hence this patch.  After initial "emptying" of /dev/kmsg when syslogd
  starts up, we raise a flag (denoting done with backlog), and after this
  point we ignore the kernel's idea of time and replace it with the actual
  time we have now, the same that userspace messages are logged with.
  Sure, there will be occasions where there's a LOT of kernel messages to
  read and we won't be able to keep track.  Yet, this patch is better than
  the current state (where we log Nov 15).
  [1]: https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg
  ===========END QUOTE ===============
  closes https://github.com/rsyslog/rsyslog/issues/4561
  closes https://github.com/rsyslog/rsyslog/issues/5161
- 2023-11-07: imfile bugfix: remove state file on file delete
  The state file would remain in the working directory
  after shutdown, even though deleteStateOnfileDelete is
  set to "on" and the monitored file was removed.
  closes https://github.com/rsyslog/rsyslog/issues/5258
  Thanks to Attila Lakatos for the patch.
- 2023-10-31: TLS subsystem: fix small memory leak on startup
  This was a one-time leak of the file name that hapened if a certificate file
  was not accessible. It had no operational issues, but could confuse automatted
  testing. As not only a side-effect, certificate load failures are now somewhat
  more verbosely reported, which we consider helpful to the user.
  Thanks to Attila Lakatos for the patch.
- 2023-10-31: imklog bugfix: keepKernelTimestamp=off config param did not work
   ... at least not as expected. It was only honored for kernel-level
   messages and only when parseKernelTimestamp was "on". Otherwise, the
   kernel timestamp was always kept inside the message.
   closes https://github.com/rsyslog/rsyslog/issues/5160
- 2023-10-26: TLS subsystem: add remote hostname to error reporting
  This provides richer and easier to process logs for error and warning
  cases. One goal is to enable automatic operations without the need
  to consolidate multiple message to a single information.
  This improves one situation in gtls driver and provides a more
  generic approach in ossl driver for OpenSSL error reporting.
  There is probably still room for improvement, however this patch
  is at least a good starting point for further work. Please
  provide feedback if you need more!
  closes https://github.com/rsyslog/rsyslog/issues/5244
- 2023-10-24: imjournal: add the ability to run multiple journal inputs
  This may be useful to de-couple journal processing.
  Thanks to Willy Tu for the patch.
- 2023-10-24: regression fix: forking rsyslogd on BSD did not work
  Actually, this was an issue for all platforms that do not provide open file handle
  detection via the /proc file system.
  Tech details: After fork if the child process uses close_range to close open file
  descriptors it has no way to exempt the parentPipeFD causing a failure to signal
  successful startup to the parent process. This causes failures on all systems that
  aren't Linux that implement close_range.
  Thanks to Nathan Huff for the patch.
- 2023-10-24: omusrmsg: use logind instead of utmp for wall messages with systemd
  Future SUSE versions will get rid of utmp due to a 32bit time_t counter
  overflow in 2038.
  See details at:
  https://github.com/thkukuk/utmpx/blob/main/Y2038.md
  On systemd based systems logind is an alternative to utmp.
  Thanks to github user tblume for the patch.
- 2023-10-24: cleanup: rm no longer used --with-systemdsystemunitdir configure switch
  This is a clean up following the removal of the service unit in
  cfd07503ba055100a84d75d1a78a5c6cceb9fdab
- 2023-10-23: testbench: bump zookeeper version to match current offering
  Older version can no longer be downloaded. It also makes sense to
  test with mainstream version.
----------------------------------------------------------------------------------------
Scheduled Release 8.2310.0 (aka 2023.10) 2023-10-10
- 2023-10-04: Add CAP_NET_RAW capability due to the omudpspoof module
  The CAP_NET_RAW ensures the use of RAW and PACKET sockets,
  which is utilized by the omudpspoof module, more precisely
  the libnet_init function.
  Thanks to Attila Lakatos for the patch.
- 2023-10-04: Add new global config option "libcapng.enable"
  Defines whether rsyslog should drop capabilities at startup or not.
  By default, it is set to "on". Until this point, if the project was
  compiled with --enable-libcap-ng option, capabilities were
  automatically dropped. This is configurable now.
  Thanks to Attila Lakatos for the patch.
- 2023-10-04: tcp net subsystem: handle data race gracefully
  It may happen that a socket file descriptor has been closed either
  while setting up poll() et al or while being inside the system call.
  This was previously treated as error and caused abort in debug
  builds. However, it was essentially ignored in production builds.
  This has now been fixed and now is always gracefully ignored. This
  most importantly fixes some flakes in CI runs (which were caused
  by this situation).
- 2023-09-29: imrelp bufgifx: avoid crash on restart in imrelp SIGTTIN handler
  While existing, if at specific time rsyslog receives a SIGTTIN, it
  crashes due to 2 issues.
  1. debug.unloadModules="off" a double free of pRelpEngine
  2. debug.unloadModules="on" it crashes because the signal handler has
     been unmapped from memory.
  This patch covers both issues.
  Thanks to Ali Abdallah for the patch.
- 2023-09-28: fix startup issue on modern systemd systems
  When we startup AND are told to auto-background ourselfs, we must
  close all unneeded file descriptors. Not doing this has some
  security implications. Traditionally, we do this by iterating
  over all possible file descriptor values. This is fairly compatible,
  because we need no OS-specific method. However, modern systemd configs
  tend to not limit the number of fds, so there are potentially 2^30(*)
  fds to close. While this is OKish, it takes some time and makes
  systemd think that rsyslog did not properly start up.
  We have now solved this by using the /proc filesystem to obtain our
  currently open fds. This works for Linux, as well as Cygwin, NetBSD,
  FreeBDS and MacOS. Where not available,and close_range() is available
  on the (build) platform, we try to use it. If that fails as well, we
  fall back to the traditional method. In our opionion, this fallback
  is unproblematic, as on these platforms there is no systemd and in
  almost all cases a decent number of fds to close.
  Very special thanks go out to Brennan Kinney, who clearly described
  the issue to us on github and also provided ample ways to solve it.
  What we did is just implement what we think is the best fit from
  rsyslog's PoV.
  (*) Some details below on the number of potentially to close fds.
      This is directly from a github posting from Brennan Kinney.
  Just to clarify, by default since systemd v240 (2018Q4), that
  should be `1024:524288` limit. As in the soft limit is the expected
  `1024`.
  The problem is other software shipping misconfiguration in systemd
  services that overrides this to something silly like
  `LimitNOFILE=infinity`.
  - Which will map to the sysctl `fs.nr_open` (_a value systemd
    v240 also raises from `2^20` to 2^30`, some distro like Debian are
    known to opt-out via patch for the `fs.nr_open` change_).
  - With the biggest issue there being that the soft limit was also
    set to `infinity` instead of their software requesting to raise
    the soft limit to a higher value that the hard limit permits.
    `infinity` isn't at all sane though.
  - The known source of this misconfiguration is container software such
    as Docker and `containerd` (_which would often sync with the
    systemd `.service` config from the Docker daemon `dockerd.service`_).
  closes https://github.com/rsyslog/rsyslog/issues/5158
- 2023-09-13: Add the 'batchsize' parameter to imhiredis
  Parameter set to allow configuring the amount of entries imhiredis debatches at once.
  Default value of '10' has been kept to avoid any side effect on existing
  configurations.
  Thanks to Jérémie Jourdin for the patch.
- 2023-09-13: omprog bugfix: Add CAP_DAC_OVERRIDE to the bounding set
  The omprog module uses the execve() function to execute
  a third party program. Some required capabilities were not
  preserved in the bounding set [1]. This caused problems, e.g.
  the program could not write to files even if rsyslog was
  executed as root and privileges were not dropped. As of now,
  only the CAP_DAC_OVERRIDE capability is added to the bounding
  set. Others could be added later, if there is justification
  behind that.
  [1] The capability bounding set is a security mechanism that
  can be used to limit the capabilities that can be gained
  during an execve(2). During an execve, the capability
  bounding set is ANDed with the file permitted capability
  set, and the result of this operation is assigned to the
  thread's  permitted  capability  set. The capability
  bounding set thus places a limit on the permitted
  capabilities that may be granted by an executable file.
  Thanks to Attila Lakatos for the patch.
- 2023-09-13: tcpflood bugfix: plain tcp send error not properly reported
  The error code when plain tcp sending failed was improperly returned,
  resulting in no meaningful error message.
  Note: tcpflood is a testbench tool, not part of production rsyslog.
----------------------------------------------------------------------------------------
Scheduled Release 8.2308.0 (aka 2023.08) 2023-08-15
- 2023-08-07: crypto subsystem bugfix: potential undefined behaviour
  The is some potential undefined behaviour when initializting the IV for locally
  encrypting log files. The issue cancels itself out, but at least causes
  some confusion when using undefined behaviour sanitizer (UBSAN). However,
  UBSAN seems not to detect the issue on all platforms and/or in all versions
  (we were not able to reproduce this issue in our CI).
  Please also note that the functionality where this can happen is extremely
  rarely being used.
  Thanks to Jeffrey Walton for providing the patch.
- 2023-08-02: lookup tables: fix static analyzer issue
  If something goes really wrong, a lookup table's name would not
  be set. That could lead to a NULL pointer access. HOWEVER, this
  would require serious bugs in config parameter parsing, as the
  lookup table name is a required parameter and the parser will
  error out if not set.
  So the bug is mostly cosmetic - but it does not hurt to handle
  this case, of course.
- 2023-08-02: lookup tables bugfix: reload on HUP did not work when backgrounded
  Lookup tables were only reloaded on HUP if the -n option was given
  and rsyslog no backgrounded. This patch fixes the issue.
  closes: https://github.com/rsyslog/rsyslog/issues/4813
- 2023-07-30: testbench: make test more reliable
  There was a race between tcpflood and rsyslog in imptpc_maxsessions.sh.
  We now use the new -A tcpflood option to make the timing more
  predictable, hopefully fixing test flakiness.
  Note: if that does not help, we need to introduce a wait on the number
  of error messages and maybe a delay before tcpflood termination. The
  theory behind the latter is that rsyslog possibly does not fully
  iniaitlize session which are quickly aborted before rsyslog receives
  the related OS notification! We just record this info in case we
  need it and are positive that this change will fix the situation.
- 2023-07-28: openssl: make connection setup more reliable by use of newer lib feature
  Replaced depreceated method SSLv23_method with TLS_method.
  In OpenSSL 1.1.0 and higher, SSLv23_method causes some errors
  in TLS handshake from time to time. As this method is depreceated
  since 1.1.0, I have replaced it with the follow up method
  TLS_method which is the most generic one.
  It fixes the random test failures in tests like
  - sndrcv_tls_ossl_anon_rebind.sh
  Also added some debug output in OpenSSL error handling, which is
  useful when analysing debug files.
  closes: https://github.com/rsyslog/rsyslog/issues/5201
- 2023-07-28: testbench improvement: define state file directories for imfile tests
  Not all imfile tests have state file directories or a global working
  directory defined. This results in usage of the default location.
  While state file names should be sufficiently different, there is still
  some riks of using the same name in different tests. That becomes
  problematic if tests are run in parallel (and they are run in
  parallel inside the regular CI).
  NOTE: NOT YET COMPLETED FOR ALL TESTS! We are considering if it makes
  sense to deliberately keep some as-is.
- 2023-07-28: tcpflood bugfix: TCP sending was not implemented properly
  Note: tcpflood is a testbench tool. This bug could lead to testbench
  false positives. No way it can affect production deployments.
  The tcpflood tool did improperly assume that a TCP sendto() call
  would send messages of any size in a single shot. This is not the
  case. It has now been corrected to proper behavior.
  As a side-activity, some int variables which acutally needed to be
  size_t have been fixed as well.
- 2023-07-28: testbench: make waiting for HUP processing more reliable
  The previous approach was more or less delay based. We have now
  changed the code to enable imdiag to detect if HUP is underway
  and wait until it is completed. The new method still employs some
  kind of timeout, but is now quite reliable. Most importantly,
  it works great with long-running HUP processing, which can happen
  e.g. when querying the system name takes long or some actions need
  longer time to persist their HUP processing.
  The new approach will most likely reduce CI flakes and also speed
  up testbench runs. The speedup happens from not having to wait a
  full delay in cases where we detect HUP is completed (plus reduced
  timeout when we cannot clearly detect this - see code comments why
  the new method is still considered more reliable than the old one).
  Code note: we needed to slightly re-structure the way actual HUP
  processing and the "HUP mutex" is handled. After best analysis,
  this does not affect the reliability or speed in production
  settings.
  closes https://github.com/rsyslog/rsyslog/issues/5192
- 2023-07-27: build system: make rsyslogd execute when --disable-inet is configured
  This option is mostly useless, as network functionality depends on the
  modules loaded by the config. The only real, and important, effect it
  has is to control auto-load of omfwd - a feature almost all installations
  depend in (backward compatibility).
  This has been clarified in ./configure -help
  Also, when --disable-inet is given, rsyslog now executes successfully.
  The reason for the abort was that previously building of the lmnet
  component was prevented, but that component is also needed by rsyslog
  startup itself to query its own (correct) hostname.
  Note that --disable-inet still does not compile some networking
  libraries. So do not use it if you intend to load standard networking
  modules like omfwd, imtcp or imudp.
  closes https://github.com/rsyslog/rsyslog/issues/5188
- 2023-07-26: testbench/CI: update zookeper download to newer version
  Old version is no longer available.
- 2023-07-24: openssl: add support for new-version init function
- 2023-07-07: add CRL support for network (TLS) drivers
  Thanks to Darren J Moffat for implementing the OpenSSL part.
- 2023-07-07: omazureeventhubs: Initial implementation of new output module
  The output module uses Apache "Qpid Proton C API" which is a solid
  AMQP protocol library implementation that can be integrated
  very well into the rsyslog dev environment.
  - Implemented Delivery with submitted and accepted state checking
  - saving of failed messages in a failed list with support of saving
    and restoring.
  - Add testcases (requires ENV variables) to testbench
  - Using application/octect-stream (binary) to send messages based on
    Microsoft Code Sample:
    https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-c-getstarted-send
    * Note original Microsoft Samplecode is not working anymore, we are using
    * QPID Proton Proactor based on
      https://github.com/apache/qpid-proton/blob/main/c/examples/send.c
  - requires QPID-PROTON Version 0.13 or higher because of the proactor API
  - Add EventProperties configuration parameters
  - Slow down when sender credit reaches zero (10ns).
  - Add support for static library linking of qpid-proton
    This is needed to build the module from source and remove
    library package dependencies.
  - adjusted valgrind suppressions
- 2023-07-04: core bugfix: action.resumeintervalmax parameter was not respected
  Unfortunately, defining action.resumeintervalmax in the configration
  did not have any effect at all. Instead, the default value was used,
  which is 1800. This was caused by not having all the letters in
  lower-case.
  Fixes https://github.com/rsyslog/rsyslog/issues/5132
  Thanks to Attila Lakatos for the patch.
- 2023-06-29: core bugfix: do not try to drop capabilities when we don't have any
  In case the process does not have any capabilities, e.g. running as regular user then
  we do not have to force capability dropping. The capng_have_capabilities() returns
  none if that's the case.
  Fixes https://github.com/rsyslog/rsyslog/issues/5091
  Thanks to Attila Lakatos for the patch.
- 2023-06-29: imhiredis bugfix: Restore compatiblity with hiredis < v1.0.0
  RESP3 protocol wasn't implemented yet, some types weren't
  available (REDIS_REPLY_DOUBLE)
  Thanks to Théo Bertin (frikilax) for the patch.
- 2023-06-23: testbench: use newer zookeeper version in tests
- 2023-06-23: build system: more precise error message on too-old lib
  When libcap-ng was enabled, the lib was present but did not meet the minimum version
  dependency during configure, it was reported as "missing". We now emit a message
  telling that it is present, but the version too old.
----------------------------------------------------------------------------------------
Scheduled Release 8.2306.0 (aka 2023.06) 2023-06-20
- 2023-06-19: mmnormalize bugfix: if msg cannot be parsed, parser chain is stopped
  When an parser is not able to parse a message, it should indicate this
  to rsyslog core, which then activates the next parser(s) inside the
  configured parser chain.
  Unfortunatley, mmnormalize always tells core "success", and so no
  other parsers are activated.
  closes https://github.com/rsyslog/rsyslog/issues/5148
- 2023-06-19: [i/o]mhiredis: various fixes and enhancements
  please see the change log for details. Among others, suspending of the modules
  has been fixed. Also a new "stream" mode has been added.
  Thanks to Théo Bertin (frikilax) for the patch.
- 2023-06-19: testbench/bug: mmexternal-SegFault-empty-jroot-vg.sh fails due to typo
  Fix the typo that makes the test fail.
  Thanks to Paul Fertser for the patch.
- 2023-06-16: imjournal: Add FileCreateMode module parameter
    FileCreateMode allows to set the default file mode bits
    when creating new files. As of now, it has only impact on the state file.
    Add test suite as well.
    Minor indentation fix in run_journal.yml
  Thanks to Attila Lakatos for the patch.
- 2023-06-16: core bugfix: potential segfault on busy systems
  This was discovered by Konstantin J. Chernov in a practicaly deployment.
  Here, msg object tag processing caused sporadic segfaults. We did not
  hear from similiar cases, but there clearly is potential for problems
  because a mutex lock had insufficient range, thus leading to a potential
  race.
  The patch is directly from Konstantin J. Chernov, thanks for that.
  Please note that the mutex lock could be minimized as it is not strictly
  needed for the pM == NULL case, but this cause is extremely exotic
  and the resulting code would be harder to understand. Thus we opt
  to do the locking on funtion level (as usual).
  Descriptiond edited by Rainer Gerhards
  closes: https://github.com/rsyslog/rsyslog/issues/5110
- 2023-06-16: Add new global config option "libcapng.default"
  Defines how rsyslog should behave in case something went wrong
  when capabilities were to be dropped. Default value is "on",
  in which case rsyslog exits on a libcapng related error.
  Thanks to Attila Lakatos for the patch.
  Closes https://github.com/rsyslog/rsyslog/issues/5096
- 2023-06-05: imfile bugfix: file handle leak, primarily in kubernetes context
  At this point there is a code imfile.c#L919 that adds an inotify observer to the
  parent of the symbolic link target. But there is no such code that removes this
  observer in the case when inotify events do not occur in the directory tree above.
  This may be if the directory tree of the symbolic link target and the directory tree
  of the symbolic link itself are divided into different subtrees somewhere at the levels
  above.
  For example, in the rsyslog configuration, an imfile with the
  template /var/log/containers/*.log is configured and there is the following directory
  tree:
    /var/log/pods/pod-1/a/0.log
    /var/log/containers/pod-1-a-0.log -> /var/log/pods/pod-1/a/0.log
  In this example, kubernetes cron jobs will permanently delete directories at the
  /var/log/pods/pod-* level. And thus, inotify observer on the parent object of the
  symbolic link target (/var/log/pods/pod-1/a/0.log) looking at the directory
  /var/log/pods/pod-1/a will constantly leak.
  This is due to the fact that the list of active objects in the edge with path
  /var/log/containers, where the parent object of the target symbolic link is added,
  is not checked. Verification and deletion will occur only in the case of an inotify
  event in the upper nodes of the directory tree, in /var/log and above.
  Thanks to Sergey Kacheev for the patch!
- 2023-06-05: GNUTls Driver: Fix memory leaks in gtlsInitCred
  Missing CA Certificate or multiple Connections caused
  a memory leak in pThis->xcred as it was allocated each time in
  gtlsInitCred by gnutls_certificate_allocate_credentials
  closes: https://github.com/rsyslog/rsyslog/issues/5135
- 2023-05-24: CI: update base ubuntu image for github actions
----------------------------------------------------------------------------------------
Scheduled Release 8.2304.0 (aka 2023.04) 2023-04-18
- 2023-04-17: imptcp bugfix: spam log on oversize message
  If an oversize message was received by imptcp, imptcp reported
  one error message for EACH oversize character. This could
  result in a potentially very large number of similar (and
  useless) messages.
  This is a regression from commit f052717178.
  closes https://github.com/rsyslog/rsyslog/issues/5078
- 2023-04-17: core/bugfix: using $uuid msg prop can deadlock rsyslog on shutdown
  This problem can occur if a large number of threads is used and rsyslog
  cannot shut down all queues etc within the regular time interval. In this
  case, it cancels some threads. That can leave the mutex guarding libuuid
  calls locked and thus prevents other, not yet cancelled threads from
  progressing. Assuming pthread_mutex_lock() is not a cancellation point,
  this will case these other threads to hang forever and thus create a
  deadlock situation.
  closes https://github.com/rsyslog/rsyslog/issues/5104
- 2023-04-17: Do not preserve capabilities when changing credentials
  In configurations where $PrivDropToGroup or $PrivDropToUser are used,
  rsyslogd changes uid/gid to a non-privileged user. As part of that
  change, all capabilities should be lost. However, if rsyslog is
  compiled with --enable-libcap-ng option, some capabilities are
  preserved due to using capng_change_id() instead of setgid()and
  setuid(). https://linux.die.net/man/3/capng_change_id:
  This function preserves capabilities while changing uid/gid, causing
  rsyslogd to run as non-root user, but with some root capabilities.
  Unfortunately, rsyslogd will run with higher privileges than before.
  The patch also removes CAP_SETPCAP, because the capability set does
  not need to be altered at a later phase.
  Thanks to Attila Lakatos for the patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2302.0 (aka 2023.02) 2023-02-21
- 2023-01-27: core/template: implement negative position.to
  This will easily permit to drop the last n characters from a property
  without the need to know the exact length of the string. This is
  especially useful as the exact length is most often not known
  beforehand.
- 2023-01-18: Introduce --enable-libcap-ng configure option
  The option allows to drop the capabilities to only
  the necessary set, to minimize security exposure in
  case there was ever a mistake in a networking
  plugin or some other input resource. Moreover, it adds
  ability to change uid and gid while retaining the
  previously specified capabilities.
  Add ability to change uid and gid while retaining the
  capabilities previously specified.
  closes https://github.com/rsyslog/rsyslog/issues/4986
  Thanks to Attila Lakatos for the patch.
- 2023-01-16:
  - omfile: add action parameters "rotation.*"
    Add new action parameters
    - rotation.sizeLimit
    - rotation.sizeLimitCommand
    provide automatic output file rotation functionality feature-wise
    equivalent to legacy $outchannel. This finally permits to use
    this feature set in rscript.
  - core substring function: enhancement and hardening
    Now, length can have a negative value -n to denote that the
    substring should be build between startpos and the character
    -n chars from the end. This is a shortcut for stripping charactes
    on "both ends" of the string. See doc for details on the enhanced
    semantics.
    Also, some hardening against invalid startpos and length has
    been added.
  - core bugfix: wrong type conversion in internal string class could lead to segfault
    This could only happen with very unusually large strings
    Thanks to Flos Lonicerae for the patch.
  - QA: changed to CodeQL scanning on github as LGTM replacement
  - bugfix: wrong version number on daily stable builds
  - CI: use newer version of zookeeper (needed modernization)
  - ffaup bugfix : memory corruption with concurrent workers
    The ffaup function fails to work properly when it is used with multiple workers.
    The faup_handler_t struct is not supposed to be shared between threads.
    This may have caused memory corruptions and race conditions when used
    inside of actions.
    Thanks to Thibaud Cartegnie for the fix.
  - openssl bugfix: undefined reference error on OpenSSL 1.1 or higher.
    This could have prevented ossl components from being loaded/used.
- 2023-01-02: core bugfix: template system may generate invalid json
  When
  - a list template
  - is created with option.jsonf="on"
  - and the last list element is a property with onEmpty="skip"
  - and that property is actually empty
  invalid JSON is generated.
  The JSON string in this case ends with ", " instead of "}\n". This
  patch fixes the issue.
  closes https://github.com/rsyslog/rsyslog/issues/5050
----------------------------------------------------------------------------------------
Scheduled Release 8.2212.0 (aka 2022.12) 2022-12-06
- 2022-12-05: testbench: make python http server based tests more reliable
  Harden them against races during server port assignment. Prevents
  testbench flakes.
- 2022-12-05: omprog bugfix: invalid status handling at called program startup
  There is a bug when external program *startup* does not return "OK". This
  can also lead to a misadressing with potentially a segfault (very unlikely).
  Note that no problem exists once the initializiation phase of the external
  program is finished and regular message transfer runs.
  The problem basically is that for a startup failure, the control data for
  that external program instance is freed on error. Unfortunately, that state
  data is needed later on to detect a suspended instance. We now keep the control
  data even on init failure (as we then need to do normal control options).
  closes https://github.com/rsyslog/rsyslog/issues/4967
- 2022-11-29: testbench bugfix: wrong message injection object of instance 1
  In some client-server test cases, messages are supposed to be injected into
  the instance 2(client), but they are actually injected into instance 1(server),
  which may lead to false negative results. This patch fixed it by replacing
  'injectmsg' with 'injectmsg2', and dealt with some minor issues.
  Thanks to Guodong Zhu for the patch.
- 2022-11-21: rsyslog.conf man page bugfix: description of selectors
  Document historic difference to BSD syslog selectors.
- 2022-11-18: imtcp bugfix: legacy config directives did no longer work
  Many "$InputTCPServer..." config directives did no longer work
  and were completely ignored (e.g. "$InputTCPServerStreamDriverMode").
  This was a regression from a08591be5d9 (May, 5th 2021).
  closes https://github.com/rsyslog/rsyslog/issues/5021
- 2022-11-16: ksi bugfix: sending of too many signing requests fixed.
  As there is a bug in libksi where too many signing requests may have bene sent
  out the amount of signing requests will be limited by KSI module until the fix
  is implemented.
  Thanks to Taavi Valjaots for the patch.
- 2022-11-14: bugfix: prevent potential segfault when switchung to queue emergency mode
  When switching to Disk queue emergency mode, we destructed the in-memory
  queue object.  Practice has shown that this MAY cause races during
  destruction which themselfs can lead to segfault. For that reason, we
  now keep the disk queueu object. This will keep some ressources,
  including disk space, allocated. But  we prefer that over a segfault.
  After all, it only happens after a serious queue error when we are
  already at the edge of hard problems.
  see also: https://github.com/rsyslog/rsyslog/issues/4963
- 2022-11-08: ksi bugfix: Segmentation fault in async mode fixed
  Thanks to Taavi Valjaots for the patch.
- 2022-11-02: imjournal: add second fallback to _COMM
  If SYSLOG_IDENTIFIER is not present in the journal message,
  then lookup the _COMM field, which stands for the name
  of the process the journal entry originates from. This is
  needed in order to be in compliance with the journalctl
  output.
  Thanks to Attila Lakatos for the patch.
- 2022-10-25: core bugfix: local hostname invalid if no global() config object given
  The local hostname is invalidly set to "[localhost]" on rsyslog startup
  if no global() config object is present in rsyslog.conf. Sending a HUP
  corrects the hostname.
  This is a regression from ba00a9f25293f
  closes https://github.com/rsyslog/rsyslog/issues/4975
  closes https://github.com/rsyslog/rsyslog/issues/4825
- 2022-10-25: testbench bugfix: fixed timing issue that sometimes lead to test failure
  Timing caused a race in test tool sync and could lead to premature termination of
  tools, which in turn caused test failure
----------------------------------------------------------------------------------------
Scheduled Release 8.2210.0 (aka 2022.10) 2022-10-18
- 2022-10-13: fix NetBSD build issue
  On NetBSD, time_t has for a long time now been __int64_t.
  On 32-bit CPUs, the compiler is not obliged to define
  __sync_bool_compare_and_swap_8, so instead this ends up
  as an undefined symbol when linking rsyslog.  This makes
  the code fall back to the pthread / locking method on these
  systems, but at least lets the program build.
  Thanks to Havard Eidnes for the patch.
- 2022-10-12: omrabbitmq: Add TLS support
  Thanks to github user 21stcavenan for the patch.
- 2022-09-14: config: add "abortOnFailedQueueStartup" global config parameter
  similiar to "abortONUncleanConfig", this parameter aborts rsyslog
  when a queue has problems during startup. Some users perfer rsyslog
  to terminate in this case. By default, nothing changes.
  closes https://github.com/rsyslog/rsyslog/issues/4902
- 2022-09-07: cor bugfix: leak in helper function SetString
  A part of rsyslog runtime, SetString(), had a small memory leak when a value was
  assigned multiple times. While this could potentially consume larger amounts of
  memory, this did not happen in practice. The reason is that multiple assignments
  to the same object occur very seldom.
  Thanks to github user seuzw930 for the patch.
  closes: https://github.com/rsyslog/rsyslog/issues/4961
- 2022-09-07: core bugfix: correct local host name after config processing
  rsyslog.conf may affect the host's local name. These changes were
  so far only activated after the first HUP. This patch now ensures
  that the configured local host name is applied correctly throughout
  all processing, including early startup.
  This patch causes a slight change of behaviour. However, the behaviour
  was inconsitent before. Now it is consistent and according to the config.
  Please note: this patch also exposes a global entry point via "regular"
  dynamic loading as this makes things much easier to do. This is in-line
  with ongoing simplification effort.
  Finally, we also remove a CI test that we do no longer need because
  the problem covered is now addressed differently and the original issue
  can no longer occur.
  closes https://github.com/rsyslog/rsyslog/issues/4975
- 2022-08-31: imtcp: add option notifyonconnectionopen
  Add this both as module an input parameter. Complements already-existing
  config param notifyonconnectionclose and mirrors the similar feature from
  imptcp.
  The module parameter acts as default, similarly to notifyonconnectionclose.
  Note that in contrast to imptcp, we emit IP addresses and not host
  names. This sticks with the traditional semantics of imtcp.
  Note that we also fixed a mislading error message in the case when a
  disallowed sender tried to connect.
  Thanks to John Chivian for suggesting the addition.
- 2022-08-26: openssl TLS driver: add mechanism to include extra CA files parameter
  This change allows to include extra CA files so that no "unable to get issuer
  certificates" issue is obtained when using chained cert files. New parameter name is
  "NetstreamDriverCAExtraFiles".
  Thanks to Sergio Arroutbi for the patch.
  closes: https://github.com/rsyslog/rsyslog/issues/4851
- 2022-08-19: fix compile issue with older gcc compilers
  Thanks to Julien Thomas for the contribution.
----------------------------------------------------------------------------------------
Scheduled Release 8.2208.0 (aka 2022.08) 2022-08-09
- 2022-08-09: ksi bugfix: request cache size and send timeout issue fixed.
  Async service send timeout is not configurable and request cache size is too
  small to handle large amount of signing requests with small amount of permitted
  requests per aggregation round. For example user with max_requests = 4 results
  cache size 5 * max_requests or at least 256. When signing 300 log files cache
  will be too small resulting several unsigned blocks. When signing 200 log file
  cache will be adequate, but with rate of 4 signatures per second, it is only
  possible to sign 4 * 10 blocks before all requests that are not sent out will
  timeout.
  Fix for the issue is to make send timeout configurable and make the size of the
  cache depend on the value of send timeout. New configuration value
  sig.block.signtimeout="time, s" introduced that defines the time window wherein
  the block has to be signed. The size of the request cache is increased to
  3 * max_requests * sign_timeout or at least 256.
  Thanks to Taavi Valjaots for the patch.
- 2022-08-09: imjournal bugfix: segmentation fault in close journal
  Thanks to github user t-feng for the patch.
- 2022-08-09: net subsystem: support sha256 for StreamDriverAuthMode="x509/fingerprint"
  Thanks to github user codemaker219 for the patch.
- 2022-08-05: imfile bugfix: message loss/duplication when monitored file is rotated
  When a to-be-monitored file is being rotated, some messages may be lost or
  duplicated. In case of duplication, many file lines may be duplicated
  depending on actual timing. The whole bug was primarily timing depenedent
  in general. It most often was visible in practice when the monitored
  file was very frequently rotated (we had some report with every few
  seconds).
  Note that while we try hard to not lose any messages, input file
  rotation always has some loss potential. This is inevitable if
  the monitored file is being truncated.
  Also note that this bugfix affects imfile, only. It has nothing to do
  and no relation to rsyslog output files being rotated on HUP.
  closes: https://github.com/rsyslog/rsyslog/issues/4797
- 2022-08-05: ksi bugfix: optimize processing of signer queue to fix delays.
  There is a worker queue where rsyslog KSI module collects events and signing
  requests. When queue is processed thread is periodically put to sleep. Previous
  implementation handles signature requests well but sleeps every time after
  handling new file open / close event. When several log files are opened or
  closed simultaneously process is significantly slowed down. Another issue is
  that thread always sleeps 1000ms that may be 2x longer than aggregation round.
  This slows down overall signing process.
  Fix for the issue is to simply not sleep after file open / close event if there
  are next items to be processed. To speed up the signing process, rsyslog uses
  KSI aggregator conf. to obtain the aggregation period that is used for the sleep
  time configuration.
  Thanks to Taavi Valjaots for the patch.
- 2022-08-04: ksi bugfix: possible crash fixed when several log files are opened.
  KSI module in async mode used to request aggregator conf. every time a log
  file was opened. When several log files were opened simultaneously
  corresponding amount of pointless concurrent conf. requests were posted.
  Concurrent conf. requests lead to a bug in libksi, where internal count of
  pending requests was not decremented correctly causing system to crash.
  Fix for the issue is to optimize the frequency of conf. requests so that only
  one conf. requests is handled at once. Instead of checking conf. every time
  log file is opened, conf is requested periodically after conf timeout. This will
  affect both sync and async mode.
  New option for KSI module introduced - sig.confinterval="time, s".
  Thanks to Taavi Valjaots for the patch.
- 2022-08-04: openssl: add support to split tls commands by semicolon
  - Add support to split tls commands by semicolon.
  - Changed one test with multiple tls commands to use semicolon as
    separator instead of newline.
  closes: https://github.com/rsyslog/rsyslog/issues/4852
- 2022-08-04: openssl subsystem bugfix: build issue on Solaris
  Needed header file was added. Platforms other than Solaris did not actually need it,
  so this bug was discovered late.
  Thanks to Jakub Kulík for the patch.
    Import <strings.h> when index() is used.
- 2022-08-04: openssl: add more details to error messages
  - Avoid LogMsg outputs osslEndSess on successfull terminated
    connection. Only LogMsg if the connection was terminated
    unsuccessfully.
  - Handle SSL_ERROR_SYSCALL in both Send / osslRecordRecv,
    do not log as error if underlaying socket was terminated
    (ECONNRESET). Log as information instead.
  closes: https://github.com/rsyslog/rsyslog/issues/4946
- 2022-08-04: omclickhouse: capture additional exceptions
    - DB::NetException
    - DB::ParsingExceptions
  Thanks to Victor Kustov for the patch.
- 2022-08-04: mmanon bugfix: Simplified and fixed IPv4 digit detection.
    - Fixed an issue with numbers above int64 in syntax_ipv4.
      Numbers that were up to 256 above the max of an int64
      could incorrectly be detected as valid ipv4 digit.
    - Simplified the IPv4 digit detection function and renamed
      to isPosByte.
    - added testcasse for malformed IPvc4 addresses
    closes: https://github.com/rsyslog/rsyslog/issues/4940
- 2022-07-21: imptcp: slight tuning
  - reduce indirect addressing to obtain more speed
  - also a fix for an annoying typo
  - minor other optimizations
  - modernization of one test
- 2022-07-20: template procesing/json: performance optimization
- 2022-07-19: core bugfix: memory leak when free action worker data table
  During free action worker data table when action destruct, worker instance in worker
  data table were not null. It resulted in memory leak.
  Thanks to github user seuzw930 for the patch.
- 2022-07-13: omfile: support for zstd compression
  The zstd library provides better and faster compression than zlib.
  This patch integrates zstd as a dynamically-loadable functionality.
  As such, no further dependencies need to be added to the rsyslog
  base package.
  Due to the increased performance, usage of zstd is highly recommended
  for high-volume use cases.
  This patch also refactor zlib compression in order to unify handling
  in both compression cases.
- 2022-07-07: stream cleanup: move error message to debug log, only
  This error message is most probably rooted in a kernel problem. At
  least knowbody knows how it can happen. It's definitely not a
  rsyslog issue. We also can recover from it for a long time now
  so there is no reason to irritate users by emitteing this
  "error" message.
- 2022-07-04: mmdblookup bugfix: Don't crash Rsyslog on mmdb file errors
  Thanks to Théo Bertin (frikilax) for the patch.
- 2022-06-28: build error fix: libbson requires out-of-date language constructs
- 2022-06-27: OpenSSL: fix depreacted API issues for OpenSSL 3.x
  - OpenSSL error strings are loaded automatically now
  - Debug Callback has changed
  - See for more:
    https://www.openssl.org/docs/manmaster/man7/migration_guide.html
  closes: https://github.com/rsyslog/rsyslog/issues/4912
----------------------------------------------------------------------------------------
Scheduled Release 8.2206.0 (aka 2022.06) 2022-06-14
- 2022-05-25: omelastisearch: allow omitting _type field
  Allow omitting the _type field by setting it to an empty string.
  Setting this field has been deprecated since 6.0, and support will
  be removed in 8.0
  Also add testbench test for empty searchType with ES 7.0
  This checks for messages in the deprecation log and also provides
  avoids deprecation messages from usage of transport.tcp.port in the
  test configuration
  Thanks to Jarkko Oranen for the patch.
- 2022-05-18: tcpsrv/imtcp: slight performance improvements
  This change slightly improves performance for tcpsrv-based servers.
  This affects imtcp and imgssapi as well as some helpers.
  No other functional change is included in this change.
- 2022-05-12: imptcp bugfix: worker thread starvation on extreme traffic
  When connectes were totally busy, without any pause, the assigened worker
  did never terminate its reading loop. As such, it could not service any
  other conenctions. If this happened multiple time and to all configured
  workers, all other connections could not be processed at all. This extreme
  scenario is very unlikely, as the whole issue is relatively unlikely.
  In practice, the issue could lead to somewhat degraded performance and
  resolved itself after some time (in practice no connection is 100% busy
  for an extended period of time).
  Note that this patch sets a fixed limit of 16 iterations for very busy
  connections. This sounds like a good compromise between non-starvation
  and performance. The exact number may be made configurable if there
  is really need to.
- 2022-05-11: omelasticsearch: several support option for ElasticSearch 8
  - config params searchIndex and documentType can be empty
  - support for Data Stream API
  Thanks to github user EHerzog76 for these changes.
  - new config param esVersion.major
- 2022-05-09: tcp receiver bugfix: delay/potential hang on some error conditions
  Error were not correctly handled in some cases for imtcp and imgssapi. This could
  lead to a temporary stall of some connections. For ultry-low traffic systems, this
  stall could stay for a long period of time. In most cases, it was resolved very quickly.
  Note that imptcp was not affected.
  Thanks to Iwan Timmer for the fix.
- 2022-05-05: net bugfix: potential buffer overrun
  there is heap buffer overflow vulnerability in rsyslog tcp reception components.
  This can only happen in octet-counted mode, which is enabled by default.
  Affected components: imtcp, imptcp, imhttp, imgssapi, imdiag when octet-counted
  framing was enabled.
  If the receiver ports are exposed to the public Internet AND are used
  without authentication, this can lead to remote DoS and potentially to
  remote code execution. It is unclear if remote code execution is
  actually possible. If so, it needs a very sophisticated attack.
  When syslog best practices with proper firewalling and authentication
  is used, thean attack can only be carried out from within the Intranet
  and authorized systems. This limits the severity of the vulnerability
  considerably (it would obviously require an attacker already to be
  present inside the internal network).
  Credits to Peter Agten for initially reporting the issue and working
  with us on the resolution.
  fixes CVE-2022-24903
  Advisory:
    https://github.com/rsyslog/rsyslog/security/advisories/GHSA-ggw7-xr6h-mmr8#advisory-comment-72243
- 2022-05-05: imptcp: set OS worker thread name
  We now set the worker thread names to "imptcp/<thrd nbr>" where
  <thrd nbr> is the numerical index (0, 1, ...) of the worker thread.
  This enables to distinguish individual worker threads in OS tools like
  htop. That is useful for performance testing and system monitoring.
  The choosen name format is consistant with other similar thread
  names inside rsyslog. For imptcp, worker threads were not yet
  given individual names.
  Note: "in:imptcp" is imptcp's "main" thread, which also is used
  as a worker in some scenarios. This name was not modified.
- 2022-04-26: mmanon bugfix: shortened IPv6 form not always anonymized
  If the IPv6 is in non-recommended form followed by a 5 digit port number, it
  is not anonymized.
  A reproducer for this is: 1a00:c820:1180:c84c::ad3f:d991:ec2e:49255
  closes https://github.com/rsyslog/rsyslog/issues/4856
- 2022-04-22: mmdblookup fix: wrong copy of buffer
  ...following parse of libmaxminddb's return after a successful search sometimes
  failed to return specific field from data.
  Thanks to Théo Bertin for the patch.
- 2022-04-22: mmdblookup: several enhancements
  - support arrays in MMDB entry
  - support escaped quotes '"' in MMDB entry
  - support '<' characters in MMDB entry, when in a field
  - support '}' characters in MMDB entry, when in a field
  Thanks to Théo Bertin for the patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2204.1 (aka 2022.04) 2022-05-05
- security bugfix: potential buffer overrun in imptcp, imtcp, imgssapi and others
  This addresses CVE-2022-24903
  see also https://github.com/rsyslog/rsyslog/security/advisories/GHSA-ggw7-xr6h-mmr8
----------------------------------------------------------------------------------------
Scheduled Release 8.2204.0 (aka 2022.04) 2022-04-19
- 2022-04-18: gnutls bugfix: possibility of infinite loop
  There was a rare possibility that the E_AGAIN/E_INTERRUPT handling
  could cause an infinite loop (100% CPU Usage), for example when a TLS
  handshake is interrupted at a certain stage.
  * After gnutls_record_recv is called, and E_AGAIN/E_INTERRUPT error
    occurs, we need to do additional read/write direction handling
    with gnutls_record_get_direction.
  * After the second call of gnutls_record_recv (Expand buffer)
    we needed to also check the eror codes for E_AGAIN/E_INTERRUPT
    to do propper errorhandling.
  * Add extra debug output based on ossl driver.
  * Potential fix for 100% CPU Loop Receiveloop after gtlsRecordRecv
    in doRetry call.
  closes https://github.com/rsyslog/rsyslog/issues/4834
  closes https://github.com/rsyslog/rsyslog/issues/4818
  closes https://github.com/rsyslog/rsyslog/issues/4638
- 2022-04-17: core/bugfix: errorfile could grow over max configures size
   When action.errorfile.maxsize configuration option is enabled and error file
   already has a certain size smaller than max size configured, it is increasing
   higher than configured max size as the error file is considered to be zero in code.
   This fix reads current error file size and limits the size to the maximum
   size configured.
   Thanks to Sergio Arroutbi for the patch.
   fixes https://github.com/rsyslog/rsyslog/issues/4821
- 2022-04-17: omkafka bugfix: potential misadressing
  The `failedmsg_entry` expects a null-terminated string in `key`, but
  here we allocate with malloc and copy a string-with-length-n into only
  the first n bytes. If the final byte is null, this is by coincidence
  only.
  This was observed by means of seeing random binary data appended to
  keys submitted to kafka apparently at random. This could also result
  in more severe problems, inclusing a segfault.
  Thanks to David Buckley for the patch.
- 2022-04-06: added new "FullJSONFmt" standard template (with addtl fields)
  This comes handy for a number of use cases, especially with ElasticSearch.
  Thanks to Art O Cathain for the patch.
- 2022-04-04: imfile: potential processing delay
  This was mentioned by Mikko Kortelainen without exact details on what exactly
  this could cause in practice. But we were confident enough that it is worth
  merging (though it does not look like something that brought real problems in
  practice, as we do not know any related reports).
  see also: https://github.com/rsyslog/rsyslog/pull/4445
  Thanks to Mikko Kortelainen for the patch.
- 2022-04-04: bugfix: cosmetic data races
  there was a more or less cosmetic data race which could happen when children
  processes died in quick sequence. Even then, no real harm happened, as all
  children were reaped eventually.
  A similar data race exists for HUP processing.
  However, these races polluted TSAN test runs, and so we fixed them
- 2022-04-01: add property options to support ISO week/year number
  Thanks to Mattia Barbon for the patch.
- 2022-04-01: core bugfix: "action suspended" message was emitted even when turned off
  Most messages were diasabled, but there was one part of the code that ignored the
  user configuration.
  Thanks to Deyneko Aleksey for the patch.
- 2022-03-31: testbench: add more tests for rscript comparison operations
- 2022-03-31: core bugfix: make internal logs emitted during HUP procesing appear quicker
  After call doHUP(), probably there is a internal log in the list. However, it
  will not be wrote out immediately, because the mainloop will be blocked at
  pselect in wait_timeout() until a long timeout or next message occur.
  More deadly, the log may be lost if the deamon exits unexpectedly.
  We might as well put processImInternal() after doHUP(), so that the message
  will be flushed out immediately.
  Fixes: 723f6fdfa6(rsyslogd: Fix race between signals and main loop timeout)
  Thanks to Yun Zhou for the patch.
- 2022-03-20: refactor: Move the parser directive to the main config
  Thanks to Attila Lakatos for the patch.
- 2022-03-16: refactor: ake the main message queue part of the config
  The intent of this patch is to make the main message queue part of the main config.
  It will help us to proceed towards dynamic configuration reload.
- regression bugfix: rsyslog may segfault during startup
  glblGetMaxLine() might be called even before the main configuration file exists
  resulting unexpected behavior, most probably segmentation fault. This is addressed
  by re-introducing the old default of 8KiB. The problem was introduced earlier in
  2022.
- regression fix: script string comparison did not work correctly
  In rscript, comparison operations on strings did not work correctly
  and returned false results. This is cause by a regression in commit
  5cec5dd634e0. While it fixed number comparisons, it introduced new
  problems in string comparisons, which were not present before. Note
  that most items in rsyslog are strings, so this can actually cause
  some problems.
----------------------------------------------------------------------------------------
Scheduled Release 8.2202.0 (aka 2022.02) 2022-02-15
- 2022-02-14: imfile bugfix: remove cause for "internal error message" (not causing harm)
  When any message is output into a renamed input file, rsyslogd output the following:
  message.
  imfile: internal error? inotify provided watch descriptor 7 which we could not find
          in our tables - ignored
  When rsyslogd detects the inode change, it deletes the entry from wdmap[]. But,
  the watch descriptor is not removed. Some application like sssd outputs some messages
  (like "HUP signal was received!!") after HUP signal is received and before switching
  into the new log file. And, the above messages can be output every log rotation.
  This situation is now resolved.
  Thanks to Masahiro Matsuya for the patch.
- 2022-02-04: rscript bugfix: literal numbers were not compared correctly
  This problem occurred when numbers were used in rsyslog.conf in
  the set statement, e.g.
  set $nbr = 1234;
  In this case, during comparisons, the number was actually interpreted
  as a string with digits. Thus numerical comparisons lead to unexpected
  results. Even more so, as in other places of the code they were
  treated as native numbers.
  This is now fixed. We cannot outrule that this causes, in border cases,
  change of behavior to existing configs. But it is unlikely and the
  previous behaviour was a clear bug and very unintuitive. This in our
  opinion it is justified to risk a breaking change for an expected
  very minor subset of installations, if any such exists at all.
  closes https://github.com/rsyslog/rsyslog/issues/4770
- 2022-02-04: omelasticsearch bugfix: indexSuccess impstats counter in bulkmode wrong
  When bulkmode is enabled, and a batch was processed without any
  failures (errors is false), the code that increments the indexSuccess
  impstats counter was never reached.
  closes: https://github.com/rsyslog/rsyslog/issues/4794
- 2022-01-17: imkmsg bugfix: effectively disabled input on error reading kmsg
  Due to a program bug, imkmsg could not recover from an kmsg read error.
  Note that recovering is possible and was intended.
  Thanks to Kailash Sethuraman for the patch.
- 2022-01-17: imtcp bugfix: worker threads were not properly terminated
  Graceful shutdown of Rsyslog could lead to segmentation faults when
  multiple imtcp inputs were being used. That is because the rest of the
  tcpsrv threads are left behind running, while their underlying objects
  are being disposed by the main thread as part of the module
  de-initialization.
  closes:  https://github.com/rsyslog/rsyslog/issues/4776
  Thanks to Gabor Orosz <goro@goro.io> for the analysis and patch.
- 2022-01-07: omlibdbi bugfix: use-after-free bug
  This occurred in when sqllite driver was used. Depending on circumstances, this had
  no visible issues (often) up to rsyslog segfault. The busier rsyslog is, the more
  likely a bad outcome.
- 2022-01-06: omhttp bugfix: memory leak in lokirest batchmode
  A JSON object was created (valueObj) but not used and also not released causing a
  memory leak. Over time, this could lead to memory overcomittent.
  closes: https://github.com/rsyslog/rsyslog/issues/4766
----------------------------------------------------------------------------------------
Scheduled Release 8.2112.0 (aka 2021.12) 2021-12-16
- 2021-12-14: refactor:Deallocate outchannel resources in rsconf destructor
  Thanks to Attila Lakatos for the patch.
- 2021-12-14: refactor: use runConf instead of loadConf in ratelimiting during runtime
  Thanks to Attila Lakatos for the patch.
- 2021-11-22: new contribtion: URL parser module function using libfa
  Thanks to Théo Bertin for the patch.
- 2021-11-18: mmanon: relax IPv6 detection - improve anonymization
  We so far tried to ensure a value is really an IPv6 address, in order
  to avoid to mangle with just similar-looking information elements.
  However, this lead to misdetection for unusual formats, e.g. when a
  port is appended to a numerical IPv6 adress given without braces [].
  This has been changed now. In a sense, we now prefer to err on the
  side of privacy.
  BEHAVIOR CHANGE:
  Previously, a suspect value was not anonymized, and thus some other
  elements (like some MAC addresses) preserved. Now the opposite is
  true, and we anonymize anything that looks close enough to be an
  IPv6 address. This improves anonymization.
  closes https://github.com/rsyslog/rsyslog/issues/4725
- 2021-11-10: ruleset bugfix: ruleset queue was incorrectly named
  The ruleset was incorrectly and unusably named. This was a regeression
  from 4a63f8e9629c3c9481a8b6f9d7787e3b3304320b.
  Many thanks to github user digirati82 for alerting us.
  closes https://github.com/rsyslog/rsyslog/issues/4730
- 2021-11-10: omsnmp: update module to current IP best practices
  The omsnmp module uses the inet_addr() function to convert the Internet host address
  from IPv4 numbers-and-dots notation into binary data in network byte order. If the input
  is invalid, INADDR_NONE (usually -1) is returned. Use of this function is problematic
  because -1 is a valid address (255.255.255.255). We should avoid its use in favor of
  inet_aton(), inet_pton(3), or getaddrinfo(3), which provide a cleaner way to indicate
  error return [1].
  This is just a request to satisfy covscan, so no error is reported at all.
  Thanks to Attila Lakatos for the patch.
- 2021-10-27: ommysql: fix threading bug
  When the MariaDB connection was (re)established, old or NULL handle
  could be used. This is fixed now.
  We need to synchronize access to the mysql handle, because multiple threads
  use it and we may need to (re)init it during processing. This could lead to
  races with potentially wrong addresses or NULL accesses. If this really
  matters mostly depends on the MariaDB/MySQL client library. It looks like
  they guard against fatal failuers. Anyhow, logging errors inside rsyslog
  could happen in any case.
- 2021-10-25: testbench: false positive when impstats was not built
  Test omfwd_fast_imuxsock failed when impstats was not built. This
  has been corrected, test is now only executed when impstats is
  present.
- 2021-10-25: imtcp: add support for permittedPeers setting at input() level
  The permittedPeers settig was actually forgotten during the refactoring
  of TLS input() level settings. This functionality is now added.
  closes: https://github.com/rsyslog/rsyslog/issues/4706
----------------------------------------------------------------------------------------
Scheduled Release 8.2110.0 (aka 2021.10) 2021-10-19
- 2021-10-13: config bugfix: global(security.abortonidresolutionfail=) did not work
  when used with rscript based configuration, it was not checked.
- 2021-10-13: config bugfix: global param $privDropToUser did not work correctly
  The parameter was not implemented for rscript based configuration and
  did not properly apply to legacy configuration. In essence, it almost always
  did not work as expected.
  see also: https://github.com/rsyslog/rsyslog/issues/4642
  see also: https://github.com/rsyslog/rsyslog/commit/cbcaf2c7e5b67e5465e47bc7cc67af2eae47bd31
- 2021-10-12: rscript bugfix: ruleset called async when ruleset had queue.type="direct"
  The call rscript statement is able to call a rule set either synchronously or
  asynchronously. We did this, because practice showed that both modes
  are needed. For various reasons we decided to make async
  calls if the ruleset has a queue assigned and sync if not.
  To know if a "queue is assigned" we just checked if queue parameters were
  given. It was overlookeded the case of someone explicitly specifying a
  "direct  queue", aka "no queue". As such, queue="direct" triggered async
  calls. That in turn meant that when a write operation to a variable was
  made inside that rule set, other rulesets could or could not see the
  write. While if was often not seen, this was a data race where the
  change could also be seen by the outside.
  This is now fixed. No matter if queue.type="direct" is specified or
  left out, the call will always by synchronous. Any values written to
  variables will also be seen by the "outside world" in later processing
  stages.
  Note that this has some potential to BREAK EXISTING CONFIGURATIONS.
  We deem this acceptable because:
  1. this was racy at all, so unexpected behaviour could alwas occur
  2. it is actually unlikely that someone used the triggering conditions
     in practice. But we can not outrule this, especially when the
     configuration was auto-generated.
  Potential compatibility issues can be solved by defining a small
  array-memory queue on the ruleset in question instead of specifying
  direct type.
  Again, we expect that almost all users will never experience any
  problems. If you do, however, please let us know: we may add an
  option to re-enable the bug.
- 2021-10-12: ksi bugfix: locking bug fixed in rsksiCtxOpenFile
  Thanks to Taavi Valjaots for the patch.
- 2021-10-11: core bugfix: fix typo in error message
  Thanks to github user jkschulz for the patch.
- 2021-10-11: tcpsrv bugfix: compilation without exceptions
  tcpsrv.c:992:1: error: label at end of compound statement
   finalize_it:
   ^~~~~~~~~~~
  Quoting from pthread.h:
    pthread_cleanup_push and pthread_cleanup_pop are macros and must always
    be used in matching pairs at the same nesting level of braces.
  Amends commit bcdd220142ec9eb106550195ba331fd114adb0bd.
  Thanks to Orgad Shaneh for the patch.
- 2021-10-11: mkubernetes bugfix: no connection retry to kubernetes APP
  When connection to the kubernates API was not possible, mmkubernetes
  did not retry. This does now happen via regular rsyslog retry
  mechanism.
  Thanks to github user jayme-github for the analysis and patch.
  closes https://github.com/rsyslog/rsyslog/issues/4669
- 2021-10-11: openssl bugfix: Correct gnutlsPriorityString (custom ciphers) behaviour
  - Only apply default anon ciphers if gnutlsPriorityString is NULL and
    Authentication Mode is set to anon. Otherwise we do not set them
    as they overwrite custom Ciphers.
  - Added two tests for custom cipher configuration (anon/certvalid mode).
  - Add call for applyGnutlsPriorityString if gnutlsPriorityString changes.
  - Merged openssl init code from Connect into osslInitSession
  closes: https://github.com/rsyslog/rsyslog/issues/4686
- 2021-10-11: build issue: handle undefined MAXPATHLEN, PATH_MAX
  While we handled missing PATH_MAX, we did not handle missing MAXPATHLEN.
  This happens under GNU/Hurd, because there is no official limit. However,
  extremely long pathes are extremely uncommon, so we do not want to
  use slow dynamic alloc each time we need to build pathes. So we
  impose a limit of 4KiB, which should be fairly enough. Note that
  this obviously increases stack requirements in GNU/Hurd.
  As suggested by Michael Biebl, we have now implemented a generic
  approach to handle this via autoconf.
- 2021-09-12: openssl: extended output information on connection failure
  Now includes the remote client/server IP address in the log output.
- 2021-09-12: imhttp enhancements - query parameter ingestion & basic auth support
  - Basic Authentication support & tests
    * configured via imhttp option "basicAuthFile". This option should be configured
      to point to your htpasswd file generated via a standard htpasswd tool.
    tests:
    * imhttp-post-payload-basic-auth.sh
    * imhttp-post-payload-basic-auth-vg.sh
  - Query parameter ingestion capability & tests
    use t `addmetadata` option to inject query parameters into
    metadata for imhttp input.
  DISTRO PACKAGERS BEWARE: NEW DEPENDENCY FOR IMHTTP:
  libaprutil (libaprutil1-dev on debian'ish, apr-util-devel on Red Hat)
  Thanks to Nelson Yen for the patch.
- 2021-09-07: testbench bugfix: privdrop tests under root user did not work
  When running under root, the privdrop tests did not properly work. This
  patch fixes the issue and skips test where necessary.
  This also includes some modernization of the related tests.
  closes https://github.com/rsyslog/rsyslog/issues/4619
- 2021-09-07: core/ratelimiting: fix rate limiting for already parsed messages
  Rate limiting may not have worked if the considered message had already
  been parsed (not having NEEDS_PARSING in msgFlags).
  This affects also imuxsock in its default configuration
  (useSpecialParser="true" and ratelimit.severity="1")
- 2021-09-07: core bugfix: use of property $wday terminates string
  When $wday is used inside a template, all template parts after it
  are ignored. For exmaple:
  template(name="json_filename" type="string" string="/var/log/%$wday%.log")
  would generate something like "/var/log/0" - the ".log" part would be
  missing. For the same reason, $wday can not reliably checked in script
  filters.
  Thanks to Alain Thivillon for reporting the bug and providing an
  excellent analysis, which essentiellay was exactly this fix here.
  closes https://github.com/rsyslog/rsyslog/issues/4670
- 2021-09-07: core/queue bugfix: potential misadressing when queue discarded messages
  When a discard mark was set, the queue was very busy and discarded messages, a
  NULL pointer access could happen. Depending on circumstances, several problems
  could occur, including a SEGFAULT. This is now fixed.
  closes: https://github.com/rsyslog/rsyslog/issues/4437
- 2021-09-07: imdiga bugfix: iOverallQueueSize calculation could be incorrect
  This issue only affects testbench and rsyslog development debugging. The active
  messages counter, used for synchronizing test steps, went wrong when the queue
  discarded messages on it's consumer thread. Now fixed.
- 2021-09-06: gnutls driver: SAN priority did not work correctly on server side
  PrioritizeSAN was not propagated when accepting a new connection, this is now fixed.
  Thanks to Attila Lakatos for the patch.
- 2021-08-24: config: implement script-equavalent for $PrivDrop* statements
  closes https://github.com/rsyslog/rsyslog/issues/891
----------------------------------------------------------------------------------------
Scheduled Release 8.2108.0 (aka 2021.08) 2021-08-17
- 2021-08-16: openssl tls: Improved error message output on tls failures.
  closes: https://github.com/rsyslog/rsyslog/issues/4645
- 2021-08-16: impstats: add percentile metrics tracking functionality
  Brief overview:
  TO configure tracking percentile metrics in rainerscript:
  User would need to define:
    - which percentile to track, such as [p50, p99, etc.]
    - window size - note, this correlates directly with memory usage to
    track the percentiles.
  To track a value, user would call built-in function `percentile_observe()` in their configurations to
  record an integer value, and percentile metrics would be emitted every
  impstats interval.
  Thanks to Nelson Yen for the patch.
- 2021-08-12: imfile: add parameter "ignoreolderthanoption"
  instructs imfile not to ingest a file that has not been modified in the
  specified number of seconds.
  Thanks to github user yanjunli76 for the patch (submitted from Nelson Yen)
- 2021-08-10: imklog bugfix: invalid memory adressing, could cause abort
  This is a regeression from commit 94c4a87. It introduced a free() call
  using an object that was no longer valid (the main pointer to the
  to-be-freed object) was already freed at time of use. This could
  cause various issues, including a segfault.
  Note: this bug was triggerred only during late phase of rsyslog
  shutdown, so it did not affect regular operation.
  Special thanks to github user wxiaoguang for analyzing the issue
  and providing a draft fix proposal, on which this patch builds.
  see also https://github.com/rsyslog/rsyslog/pull/4629
  closes https://github.com/rsyslog/rsyslog/issues/4625
- 2021-08-09: imfile bugfix: deleteStateOnFileDelete missed some state files
  When the log file is deleted, imfile would attempt to delete the statefile but it
  was missing the file_id part of the statefile name. This means the statefiles were
  only removed in the log file was less than 512 characters, because for very small
  files the file ID hash is not created. This lead to some state files not being
  deleted.
  Thanks to pearseimperva for the patch.
- 2021-08-09: imfile bugfix: hash char invalidly added in readmode != 0
  If imfile is ingesting log files with readMode set to 2 or 1, the resulting
  messages all have a '#' character at the end. This patch corrects the behaviour.
  Note: if some external script "supported" the bug of extra hash character at
  the end of line, it may be necessary to update them.
  closes https://github.com/rsyslog/rsyslog/issues/4491
- 2021-08-09: omelasticsearch bugfix: errorFile mutex was not consistently locked
  Lock the file during SIGHUPs to avoid issues with concurrent accesses by
  writeDataError().
  Thanks to François Poirotte for the patch.
- 2021-08-09: imudp: add socket type (IPv4 vs. 6) to input name
  Most importantly, the input name is used for stats counter names as
  well. Previously, the same name was used for IPv4 and IPv6, so we had
  two counters with an equal name. That left users puzzled.
  Unfortunately, this change can potentially require changes to existing
  analysis scripts, as the name is now slightly different.
  closes https://github.com/rsyslog/rsyslog/issues/4364
- 2021-08-06: omfwd: add capability for action-specific TLS certificate settings
  This permits to override the global definitions for TLS certificates
  at the action() level.
- 2021-08-06: imfile bugfix: file handle leak if "freshStartTail" was turned on
- 2021-08-05: imtcp: permit to use different certificate files per input/action
  This completes the ability to override global/default TLS settings at the imtcp
  input() level. Support for using multiple CAs/Certs per Connection is now provided.
- 2021-08-04: imptcp bugfix: keep alive interval was incorrectly set
  The interval was accidentally set to keep alive interval. This has been
  corrected.
  closes https://github.com/rsyslog/rsyslog/issues/4609
- 2021-07-08: openssl network driver bugfix: small memory leak
  Fixes a static, non-growing memory leak which existed when parameter
  "GnutTLSPriorityString" was used. This was primarily a cosmetic issue,
  but caused some grief during development in regard to memory leak
  detectors.
  Note: yes, this is for openssl -- the parameter name is historical.
- 2021-07-07: psrv bugfix: abort if no listener could be started
  Modules (like imtcp and imdiag) which use tcpsrv could abort or
  otherwise malfunction if no listener for a specific input could
  be started.
  Found during implementing a new feature, no report from practice.
  But could very well happen.
- 2021-07-07: mmkubernetes bugfix: apiserver error handling
  - Added graceful handling of apiserver errors with unexpected responses,
    i.e., anything other than 200, 404, or 429. Idea is that apiserver
    transient error state will recover. We don't want mmkubernetes to miss
    metadata resolution for containers that don't have cached metadata.
    During these transient error states, mmkubernetes will provide basic
    container file path based resolution of namespace and pod metadata for
    new pods whose metadata is not yet cached. After this error state
    recovers, mmkubernetes is expected to resume its metadata resolution as
    expected.
  - Added a unit test case for apiserver return 500 with changes to mock server
  -  Fixed existing unit test that was failing due to missing expected results file
  -  Added mmkubernetes unit tests to testbench
  Thanks to Abdul Waheed for the patch (submitted from Nelson Yen).
- 2021-07-07: ommongodb bugfixes
  - Fix Segmentation fault when server is down
  - Add server connexion check while resuming
  Thanks to Kevin Guillemot for the patch.
- 2021-06-28: omkafka improvements
  - drain librdkafka queues and retry later during rsyslog restart or hup. This
    re-injects messages into rsyslog's native queues.
  - add statsname on per kafka instance for better visibility
  - omkafka - count errors related ssl as "errors_ssl"
  Thanks to Nelson Yen for the patch.
- 2021-06-23: some CI/QA improvements, Travis-CI disabled
  For the time being, Travis CI is disabled because it was outdated and Travis also
  changed their system. We will re-evaluate if we re-enable it. Since quite a while
  the Travits tests were redundant with the rest of CI, so this does not reduce
  coverage.
- 2021-06-23: omhttp bugfix: dynrestpath param in batch mode invalid
  When batchmode was used, the templates could not be used to
  expand dynrestpath. We are now storing the restpath param
  within the batch data if we are in batch mode.
  When we are in batch mode, and the restpath value changes, the
  batch is submitted and reinitialized
  closes: https://github.com/rsyslog/rsyslog/issues/4567
- 2021-06-17: add predefined template RSYSLOG_SyslogRFC5424Format
  This is essentially the same as RSYSLOG_SyslogProtocol23Format with
  a better name and a fix to remove the unnecessary LF at the end of
  the message.
  The different name also enables us to fix the LF issue without
  any concern about backwards compatibility.
  closes https://github.com/rsyslog/rsyslog/issues/4384
- 2021-06-17: impstats/bugfix: _sender_stats reports integer counter as string
  Note that this introduces a small backwards incompatibility: in previous output
  the field was of string type, now it is integer (as intended). We discussed this
  on the mailing list and the overwhelming thought was that this is not a problem
  because almost all analysis backends are able to cover that format change. This made
  the bugfix essentially costmetic.
  HOWEVER, if you still experience issues, please let us know. We can add an option
  to provide the previous format, and just spared to do so because there was no
  evidence it was needed.
----------------------------------------------------------------------------------------
Scheduled Release 8.2106.0 (aka 2021.06) 2021-06-15
NOTE: the prime new feature is support for TLS and non-TLS connections
via imtcp in parallel. Furthermore, most TLS parameters can now be overriden
at the input() level. The notable exceptions are certificate files, something
that is due to be implemented as next step.
- 2021-06-14: new global option "parser.supportCompressionExtension"
  This permits to turn off rsyslog's single-message compression extension
  when it interferes with non-syslog message processing (the parser
  subsystem expects syslog messages, not generic text)
  closes https://github.com/rsyslog/rsyslog/issues/4598
- 2021-05-12: imtcp: add more override config params to input()
  It is now possible to override all module parameters at the input() level. Module
  parameters serve as defaults. Existing configs need no modification.
- 2021-05-06: imtcp: add stream driver parameter to input() configuration
  This permits to have different inputs use different stream drivers
  and stream driver parameters.
  closes https://github.com/rsyslog/rsyslog/issues/3727
- 2021-04-29: imtcp: permit to run multiple inputs in parallel
  Previously, a single server was used to run all imtcp inputs. This
  had a couple of drawsbacks. First and foremost, we could not use
  different stream drivers in the varios inputs. This patch now
  provides a baseline to do that, but does still not implement the
  capability (in this sense it is a staging patch).
  Secondly, we now ensure that each input has at least one exclusive
  thread for processing, untangling the performance of multiple
  inputs from each other.
  see also: https://github.com/rsyslog/rsyslog/issues/3727
- 2021-04-27: tcpsrv bugfix: potential sluggishnes and hang on shutdown
  tcpsrv is used by multiple other modules (imtcp, imdiag, imgssapi, and,
  in theory, also others - even ones we do not know about). However, the
  internal synchornization did not properly take multiple tcpsrv users
  in consideration.
  As such, a single user could hang under some circumstances. This was
  caused by improperly awaking all users from a pthread condition wait.
  That in turn could lead to some sluggish behaviour and, in rare cases,
  a hang at shutdown.
  Note: it was highly unlikely to experience real problems with the
  officially provided modules.
- 2021-04-22: refactoring of syslog/tcp driver parameter passing
  This has now been generalized to a parameter block, which makes it much cleaner and
  also easier to add new parameters in the future.
- 2021-04-22: config script: add re_match_i() and re_extract_i() functions
  This provides case-insensitive regex functionality.
  closes https://github.com/rsyslog/rsyslog/issues/4429
----------------------------------------------------------------------------------------
Scheduled Release 8.2104.0 (aka 2021.04) 2021-04-20
- 2021-04-19: new contributed module imhiredis
  Thanks to Théo Bertin (frikilax) for the patch.
- 2021-04-19: new built-in function get_property() to access property vars
  Provides ability to evaluate a rsyslog variable using dynamically
  evaluated parameters.
  1st param is the rsyslog param, 2nd param is a key, can be an array
  index or key string.
  Useful for accessing json sub-objects, where a key
  needs to be evaluated at runtime. Can be used to access arrays as well.
  Thanks to Nelson Yen for contributing this module.
- 2021-04-19: mmdblookup: add support for mmdb DB reload on HUP
  Thanks to Théo Bertin (frikilax) for the patch.
- 2021-04-19: script bugfix: empty array in foreach() improperly handled
  When running a foreach() loop inside a ruleset, if the json array/object iterated
  over is empty but valid, the foreach will make the message processing in the
  ruleset abort operation, no following operation (such as actions) will be
  executed after this.
  Thanks to Théo Bertin (frikilax) for the patch.
- 2021-04-19: imjournal bugfixes (handle leak, empty file)
  Flush the FILE* buffer before rename & fsync in order
  to not end up syncing an empty file.
  Also, close WorkDir on fsync in order to prevent
  file descriptor leakage.
  Thanks to github user gerd-rausch for the fix.
- 2021-04-06: new contributed function module fmunflatten
  This commit adds a new rainerscript function to unflatten keys in a JSON tree. It
  provides a way to expand dot separated fields.
  <result> = unflatten(<source-tree>, <key-separator-character>);
  It allows for instance to produce this: { "source": { "ip": "1.2.3.4", "port": 443 } }
  from this source data: { "source.ip": "1.2.3.4", "source.port": 443 }
  Thanks to Julien Thomas for the contribution.
- 2021-02-22: test bugfix: some tests did not work with newer TLS library versions
  Newer versions provide TLS versions that cannot be disabled in older versions as they
  are unknown there. This is solved by setting restrictions in multiple steps. For
  older library versions, the final step will error out, but the other one be applied.
  This permits to achieve proper test results.
  closes: https://github.com/rsyslog/rsyslog/issues/4534
- some improvements to project CI
----------------------------------------------------------------------------------------
Scheduled Release 8.2102.0 (aka 2021.02) 2021-02-16
- 2021-02-15: omfwd: add stats counter for sent bytes
  Thanks to John Chivian for suggesting this feature.
- 2021-02-15: omfwd: add error reporting configuration option
  RSyslog on a plain TCP cannot guarantee the message delivery
  without using RELP protocol. Besides that the logs may be
  flooded with connection errors making the rest of messages
  difficult to find. To alleviate the problem (see issue 3910),
  this patch adds a configuration option that enables to reduce
  the number of network errors logged and reported.
  For example, if each 10th network error message should be logged,
  the rsyslog configuration has to be updated as follows.
  action(type="omfwd" Target="<IP_ADDR>" Port="<PORT>" Protocol="tcp" ConErrSkip="10")
  Thanks to Libor Bukata for the patch.
- 2021-02-15: action stats counter bugfix: failure count was not properly incremented
  In some cases the counter was not incremented, most notably with transaction-enabled
  actions.
  Thanks to github user thinkst-marco for the patch.
- 2021-02-15: action stats counter bugfix: resume count was not incremented
  And so it always stayed at zero.
  Thanks to github user thinkst-marco for the patch.
- 2021-02-15: omfwd bugfix: segfault or error if port not given
  If omfwd is configured via RainerScript config format and the "port"
  parameter is not given, a segfault will most likely happen on
  connection establishment for TCP connections. For UDP, this is
  usually not the case.
  Alternatively, in any case, errors may happen.
  Note that the segfault will usually happen right on restart so this
  was easy to detect.
  We did not receive reports from practice. Instead, we found the bug
  while conducting other work.
- 2021-01-29: lookup table bugfix: data race on lookup table reload
  A data race could happen when a lookup table was reloaded. We found
  this while moving to newer version of TSAN, but have no matching
  report from practice. However, there is a potential for this to cause
  a segfault under "bad circumstances".
- 2021-01-18: testbench modernization
  Bump dependency versions, use newer distro versions for some tests.
  Make kafka distcheck separate to help diagnose flaky kafka tests.
- 2021-01-16: testbench: fix invalid sequence of kafka tests runs
  kafka tests can not run well in parallel (mostly due to ressource
  constraints on CI machines). Accidentally, this was not enforced for
  one of the tests. That could lead to random failures and false positives.
- 2021-01-14: testbench: fix kafkacat issues
  The kafkacat tool has an upper limit of how many messages it can send
  at once. Going over that limit causes messages loss. The exact limit
  seems to depend on the environment. This causes testbench false positives.
  This commit fixes two related issues:
  - errors during kafkacat run were not detected - this has been added
  - we now have a "max messages at once" setting, after which kafkacat
    is restarted for the next batch of messages. It currently is set
    to 25,000 msgs per incarnation. All tests loop now to send the
    required number of messages. This has been fixed at the testbench
    framework level, so no need to adjust individual tests.
- 2021-01-14: testbench: fix year-dependendt clickhouse test
  A test had the year value hardcoded and as such failed whenever the
  year changed. This patch corrects that.
----------------------------------------------------------------------------------------
Scheduled Release 8.2012.0 (aka 2020.12) 2020-12-08
- 2020-12-07:  testbench bugfix: some tests did not work in make distcheck
  - certificate file missing in dist tarball
  - some test cases did not properly specify path to cert file
  Thanks to Michael Biebl for alerting us and providing part of
  the fix.
  closes https://github.com/rsyslog/rsyslog/issues/4446
- 2020-12-07: immark: rewrite with many improvements
  - mark message text can now be specified
  - support for rulesets
  - support for using syslog API vs. regular internal interface
  - support for output template system
  - ability to specify is mark message flag can be set
  - minor changes and improvements
- 2020-11-30: usability: re-phrase error message to help users better understand cause
  see also https://github.com/rsyslog/rsyslog/issues/3910
- 2020-11-10: add new system property $now-unixtimestamp
  Among others, this may be used as a monotonic counter
  for doing load-balancing and other things.
  Thanks to Nicholas Brown for suggesting this feature.
- 2020-11-04: omfwd: add new rate limit option
  Adding new rate limit option to omfwd for rate limiting
  syslog messages sent to the remote server
  ratelimit.interval:
      Specifies the rate-limiting interval in seconds.
      Default value is 0, which turns off rate limiting.
  ratelimit.burst
          Specifies the rate-limiting burst in number of messages.
  closes https://github.com/rsyslog/rsyslog/issues/4423
  Thanks to Dinesh-Ramakrishnan for the patch.
- 2020-11-03: omfwd bug: param "StreamDriver.PermitExpiredCerts" is not "off" by default
  The default behaviour of expired certificates of stream driver in TLS mode, should
  have been that the see tcp transmission is closed due to expired certificates, and
  error messages emited in rsyslog status. This was not the case. That in turn could
  lead to permitting sessions which should not be permitted.
  Thanks to Vincent Zhu for alerting us and providing a great problem analysis
  closes: https://github.com/rsyslog/rsyslog/issues/4425
----------------------------------------------------------------------------------------
Scheduled Release 8.2010.0 (aka 2020.10) 2020-10-20
- 2020-10-13: gnutls TLS subsystem bugfix: handshake error handling
  If the tls handshake does not immediatelly finish, gnutls_handShake is called in
  doRetry handler again. However the error handling was not
  complete in the doRetry handler. A failed gnutls_handShake call
  did not abort the connection and properly caused unexpected
  problems like in issues:
  https://github.com/rsyslog/rsyslog/issues/4270
  https://github.com/rsyslog/rsyslog/issues/4288
- 2020-10-13: core/msg bugfix: memory leak
  There is a missing call to json_object_put(json) if the call to
  jsonPathFindParent() failed. It's leaking memory. Depending on workload and config,
  this leak can potentially grow large (albeit we did not see reports from practice).
  Thanks to Julien Thomas for the patch.
- 2020-10-13: core/msg bugfix: segfault in jsonPathFindNext() when <root> not an object
  The segfault gets happens when <bCreate> is 1 and when the <root>
  container where to insert the <namebuf> key is not an object.
  Here is simple reproducible test case:
  // ensure we start fresh
  // unnecessary if there was no previous set
  unset $!;
  set $! = "";
  set $!event!created = 123;
  Thanks to Julien Thomas for the patch.
- 2020-10-13: openssl TLS subsystem: improvments of error and status messages
  Adding error logs at the ssl handshake failure scenarios.
  Adding the header "nsd_ossl:" tag to these logs to identify
  the origin module from which logs are generated.
  Thanks to Anusha Pai G for the patch.
- 2020-10-06: add 'exists()' script function to check if variable exists
  This implements a way to check if rsyslog variables (e.g. '$!path!var') is
  currently set of not.
  Sample: if exists($!somevar) then ...
  closes https://github.com/rsyslog/rsyslog/issues/4385
- 2020-10-03: core bugfix: do not create empty JSON objects on non-existent key access
  Performing a condition (eg: check for an empty string) on a subtree key that do not
  exists (depth > 1 from the root container), creates an empty "parent" object.
  Depending on your context, you may end up with (kind of...) annoying garbage when
  producing object documents (for instance to index in ES).
  Also fixes a hypothetical hang condition with an almost (?) unused plugin parameter
  passing mode, for details see
  https://github.com/rsyslog/rsyslog/issues/4436
  closes https://github.com/rsyslog/rsyslog/issues/4430
  Thanks to Julien Thomas for the patch.
- 2020-09-28: gnutls subsysem bugfix: potential hang on session closure
  Some TLS servers don't reply to graceful shutdown requests "for
  optimization". This results in rsyslog's omfwd+gtls client to wait
  forever for a reply of the TLS server which never comes, due to shutting
  down the connection with gnutls_bye(GNUTLS_SHUT_RDWR).
  On systemd systems, commands such as "systemctl restart rsyslog" just
  hang for 1m30 and rsyslogd gets killed upon timeout by systemd.
  This is fixed by replacing the call to gnutls_bye(GNUTLS_SHUT_RDWR) by calls to
  gnutls_bye(GNUTLS_SHUT_WR) which is sufficient and doesn't wait for a
  server reply.
  As an example, Kiwi Syslog server is known to cause this issue.
  Thanks to Renaud Métrich for the patch.
- 2020-09-23: core/network bugfix: obey net.enableDNS=off when querying local hostname
  Local hostname resolution used DNS queries even if the enableDNS was set to off, and
  this could cause unexpected delays in the HUP signal handling if the DNS server was
  not responsive.
  Thanks to Samu Nuutamo for the fix.
- 2020-09-14: core bugfix: potential segfault on query of PROGRAMNAME property
  A data race can happen on variable iLenProgram as it is not guarded
  by the message mutex at time of query. This can lead to it being
  non -1 while the buffer has not yet properly set up.
  Thanks to Leo Fang for alerting us and a related
  patch proposal.
  replaces https://github.com/rsyslog/rsyslog/pull/4300
- 2020-09-14: imtcp bugfix: broken connection not necessariy detected
  Due to an invalid return code check, broken TCP sessions could not
  necessarily be detected "right in time". This can result is the loss
  of one message.
  closes https://github.com/rsyslog/rsyslog/issues/4227
  Thanks to Leo Fang for the patch.
- 2020-09-14: new module: imhttp - http input
  permits to receive log data via HTTP.
  uses http library to provide http input.
  user would need to configure an 'endpoint' as input, along
  with a ruleset, defining how the input should be routed in
  rsyslog.
  Thanks to Nelson Yen for contributing this module.
- 2020-09-11: mmdarwin bugfix: potential zero uuid when reusing existing one
  - fix a use-after-free variable during darwin uuid message extraction
  - improve debug/output by logging uuid parse errors
  Thanks to github user frikilax for the patch.
- 2020-09-10: imdocker bugfix: build issue on some platforms
  An invalid variable type was used, leading to compile errors at least on
  all platform that use gcc 10 and above. Otherwise, however, it looks like the
  issue caused no real harm.
- 2020-09-07: omudpspoof bugfix: make compatbile with Solaris build
  Thanks to Dagobert Michelsen for the patch.
- 2020-09-03: testbench fix: python 3 incompatibility
- 2020-09-02: core bugfix: segfault if disk-queue file cannot be created
  When using Disk Queue and a queue.filename that can not be created
  by rsyslog, the service does not switch to another queue type as
  supposed to and crashes at a later step.
  closes: https://github.com/rsyslog/rsyslog/issues/4282
- 2020-08-26: cosmetic: fix dummy module name in debug output
  When we have optional components (like imjournal) a dummy module
  is used. It's sole purpose is to emit "this module is not available".
  During init, the module emitted an invalid module name into the debug
  log. This has now been replaced by the generic term "dummy".
  Note: it is highly unlikely that someone will ever see that message
  at all, as it is unlikely for the dummy modules to be build.
  see also: https://github.com/rsyslog/rsyslog/commit/84a7e3d80b80106dcc86c273ed8cf78a6c11c722#r41782830
  Thanks to Thomas D. (whissi) for the patch.
- 2020-08-26: config bugfix: intended warning emitted as error
  When there are actions configured after a STOP, a warning should be
  emitted. In fact, an error message is generated. This prevents the
  construct, which may have some legit uses in exotic settings. It
  may also break older configs, but as the message is an error
  for so long now, this should be no longer of concern.
----------------------------------------------------------------------------------------
Scheduled Release 8.2008.0 (aka 2020.08) 2020-08-25
- 2020-08-25: imdocker bugfix: error reporting not always correct
  A wrong function to obtain the error code was used. This
  could lead to invalid error messages.
  Thanks to Steve Grubb for the bug report and fix proposal.
  closes https://github.com/rsyslog/rsyslog/issues/4381
- 2020-08-25: imptcp: add max sessions config parameter
  The max is per-instance, not global across all instances.
  There is also a bugfix where if epoll failed I think we could leave a
  session linked in the list of sessions, this code unlinks it.
  Thank to Alfred Perlstein for the patch.
- 2020-08-24: omelasticsearch bugfix: reply buffer reset after health check
  The issue happens when more than one server is defined on the
  action. On that condition a health check is made through
  checkConn() before sending the POST. The replyLen should be
  set back to 0 after the health check, otherwise the response
  data received from the POST gets appended to the end of the
  last health check.
  Thanks to Julien Thomas for the patch.
- 2020-08-14: omfile: do no longer limit dynafile cache size in legacy format
  When using obsolete legacy config format, omfile had a hard limit of
  1,000 dynafile cache entries. This does not play well with very
  large installation. This limit is now removed and converted into
  a warning if cache size > 25,000 is specified.
  Note: the problem can easily be worked-around by using modern
  config format (RainerScript).
  closes: https://github.com/rsyslog/rsyslog/issues/4241
- 2020-08-13: imudp: fix very small, static memory leak
  When ruleset support was used, the ruleset name was not freed upon rsyslog
  termination. While this has no consequences for regular runs, it generates
  leak errors under memory debuggers and as such makes debugging harder than
  necessary.
  Thanks to github user frikilax for the patch.
- 2020-08-13: omelasticsearch: add parameter skipPipelineIfEmpty
  When POST'ing a document, Elasticsearch does not allow an empty pipeline
  parameter value. This patch introduces boolean option skipPipelineIfEmpty
  to the omelasticsearch action. When set to true, the pipeline parameter
  won't be posted. Default is false so we do not modify current behavior.
  Thanks to Julien Thomas for the patch.
- 2020-08-12: systemd service file removed from project
  This was done as distros nowadays have very different service files and it no
  longer is useful to provide a "generic" (sic) example.
  see also: https://github.com/rsyslog/rsyslog/issues/4333
- 2020-08-11: gnutls TLS driver bugfix: EKU check not done properly
  When the server accepted a new connection, it did not properly set the
  dataTypeCheck field based on the listening socket. That resulted in
  skipping ExtendedKeyUsage (EKU) check on the client.
  Thanks to Daiki Ueno for the patch.
- 2020-08-06: MMDARWIN:: improve configuration flexibility and UUID fix
  -t pu now able to get fields from local variables ($.)
  - now able to configure a custom root container for mmdarwin fields
  - now able to put nested keys ($!key1!key2)
  - don't regenerate a UUID each time, but instead check if one exists before
    creating it (allow successive calls without losing previous UUID)
  Thanks to github user frikilax for the contribution.
- 2020-08-06: add --enable-imjournal=optional ./configure option
- 2020-08-06: IMPCAP::Fixes: segfault, memory and build corrections
  * fix bug in ethernet packets parsing
  * fix removes build error with gcc10: 'multiple definition of...'
  * resolve memory leak during interface init failure (device not freed after post-create error)
  * add test 'impcap_bug_ether' to prove ethernet parser fix is working
  Thanks to github user frikilax for the contribution.
  closes https://github.com/rsyslog/rsyslog/issues/4332
- 2020-07-14: CI: add support for github actions
- 2020-07-14: imklog: add ruleset support
  see also: https://github.com/rsyslog/rsyslog/issues/4344#issuecomment-658001854
  see also: https://github.com/rsyslog/rsyslog/issues/106
- 2020-07-06: config system fix: ChkDisabled method to make config.enabled work
  There was wrong negation in the method so it returned 0/1 in reverse
  and also it did not mark the node to not be reported as unknown at all
  times which is needed after all.
  Thanks to Jiri Vymazal for the patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2006.0 (aka 2020.06) 2020-06-23
- 2020-06-22: queue: permit ability to double size at shutdown
  This prevents message loss due to "queue full" when re-enqueueing data
  under quite exotic settings.
  see also https://github.com/rsyslog/rsyslog/issues/3941#issuecomment-549765813
  closes https://github.com/rsyslog/rsyslog/issues/4020
- 2020-06-22:Fixing imfile segfaulting on selinux denial
  If imfile is denied access to file watched trough symlink there is
  unchecked condition resulting in access to not initialized memory.
- 2020-06-22: openssl: Fixed memory leak when tls handshake failed.
  closes: https://github.com/rsyslog/rsyslog/issues/4319
- 2020-06-22: change systemd service file to wait for network
  now that rsyslog is usually only installed for real syslog servers,
  we should assume that some network listening or forwarding happens
  on start. As such we need to start a bit later, after the network.
  This poses no problem as systemd nowadays comes with journal which
  is in almost all cases configured to buffer log data while
  rsyslog is not yet running.
  see also https://github.com/rsyslog/rsyslog-pkg-rhel-centos/issues/72
- 2020-06-22: NEW INPUT MODULE:: impcap, network packets input parser
  Thanks to github user frikilax for the contribution.
- 2020-06-22: ksi bugfix: Optimized code in KSI module initialization fixed.
  KSI module initialization will not stuck in infinite loop when code is
  built with optimization -O2.
- 2020-06-05: operatingstatefile bugfix: month was given too low
  The month was printed with the range 0 (January) to 11 (December).
  This has now been corrected.
  closes https://github.com/rsyslog/rsyslog/issues/4292
- 2020-06-05: build system: add "optional" build functionality to some components
  Nameley:
    --enable-libdbi=optional
    --enable-mmdblookup=optional
    --enable-imkafka=optional
    --enable-omkafka=optional
  If used, builds a dummy module which just emits a "module not supported
  on this platform" error message when loaded.
  Primary use case for this system is Debian-ish builds on SUSE OBS,
  where we prefer to have a single package definition for all versions
  (else things get much more complicated).
- 2020-05-23: config system bugfix: backticks cat segfault if file cannot be opened
  when a `cat <filename>` construct is used in rsyslog.conf and <filename> can not
  be accessed (does not exist, no permissions, ...), rsyslog segfaults.
  Thanks to Michael Skeffington for notifying us and providing root cause analysis.
  closes https://github.com/rsyslog/rsyslog/issues/4290
- 2020-05-15: imtcp bugfix: octet framing/stuffing problem with discardTruncatedMsg on
  When "discardTruncatedMsg" was enabled in imtcp, messages were incorrectly
  skipped if the last character before the truncation was the LFdelimiter.
  Also adds two testbench tests for this case.
  closes: https://github.com/rsyslog/rsyslog/issues/4281
- 2020-05-12: ompipe bugfix: race during HUP
  When HUP was received, the write mutex was not acquired. This could
  lead to unexpected invalidation of the output file descriptor.
  Thanks to Julien Thomas for alerting us on this issue.
  see also https://github.com/rsyslog/rsyslog/pull/4136#issuecomment-578326278
- 2020-05-12: ompipe: add action parameter tryResumeReopen
  Sometimes we need to reopen a pipe after an ompipe action gets
  suspended. Sending an HUP signal to rsyslog does the job but requires
  an interraction with rsyslog. The patch adds support for a new boolean
  option, tryResumeReopen, for the ompipe action. It mimics what an HUP
  signal would do.
  Thanks to Julien Thomas for the patch.
- 2020-05-12: imjournal: remove strcat call
  Thanks to Jeff Marckel for the patch.
- 2020-05-12: build system: libzcmq version requirement needs to be bumped
  Thanks to Thomas Deutschmann for pointing this out.
  closes https://github.com/rsyslog/rsyslog/issues/3957
- 2020-05-12: testbench: download ElasticSearch binaries from rsyslog.com
  The official ElasticSearch download site sometimes denies the download.
- 2020-05-11: openssl netstream driver bugfix: context leak
  The context object was not properly freed.
  Thanks to Michael Zimmermann for the fix.
- 2020-05-11: omhttp: Add support for multiple http headers
  Allows the inclusion of multiple http headers on the REST call.
  Thanks to callmegar for the patch.
- 2020-04-29: core bugfix: group id could not be obtained for very large groups
  Thanks to github user emilbart for the patch.
- 2020-04-29: testbench additions (relp broken connection test)
- 2020-04-29: omudpspoof bugfix: issues with oversized messages
  First issue was an incorrect packet length in UDP Header. It has to be the FULL UDP Packet
  regardless of the MTU Setting. As a result regardless of IP fragmentation, the MTU setting
  also limited the siizmax size of the UDP message.
  The second issue was incorrect calculation of the UDP Checksum with libnet if
  IP fragmentation was used (Based on MTU Setting). As a result, the network packets were
  dropped by the tcp stack before they even could reach there target. The workarround for this
  problem is, that we set the UDP Checksum to 0x0000 which allows skipping of the checksum
  test. Fixing the problem by calculating the correct UDP Checksum would require some
  code changes in the libnet.
  Also fixed the omudpspoof bigmsg test and increased the testing size to 16KB.
- 2020-04-29: omprog: fix assert failed on HUP with output flag
  If the 'output' setting of omprog was used and rsyslog received a HUP
  signal just after starting (and before the omprog action received the
  first log to process), an internal assertion could fail, causing
  rsyslog to terminate. The failure message was "rsyslogd: omprog.c:660:
  closeOutputFile: Assertion `pCtx->bIsRunning' failed."
  The failure could also occur if rsyslog received a HUP signal during
  the shutdown sequence.
  This bug was introduced in v8.2004 by PR https://github.com/rsyslog/rsyslog/pull/4255
  Although a test already existed that checked the interaction of HUPs
  with the 'output' setting, it didn't always fail in this particular case
  due to timing conditions. The test has been improved to cover this case
  more reliably.
  Thanks to Joan Sala Isern for the patch.
----------------------------------------------------------------------------------------
Scheduled Release 8.2004.0 (aka 2020.04) 2020-04-28
- 2020-04-28: ksi bugfix: When KSI module is suddenly closed, files are finalized
  In async. mode all pending signature requests are closed immediately and
  unsigned block marker is attached with message about sudden closure.
  Similar approach is used for blocks that already contain some records.
  Empty blocks are just closed without any metadata.
  Thanks to Taavi Väljaots for the patch.
- 2020-04-28: ksi bugfix: Signer thread initialization is verified before usage.
  When signer thread is created in rsksiInitModule thread successful
  initialization is verified before returning the function. This will
  prevent adding records to not initialized module and in case of an
  error signature files opened will contain only magic bytes.
  Thread flags replaced with thread state.
  When init module fails, module is disabled.
  Thanks to Taavi Väljaots for the patch.
- 2020-04-28: ksi bugfix: Hardcoded default hash algorithm replaced with 'default'
  Instead of hardcoded SHA-256 KSI_getHashAlgorithmByName("default")
  is used to get default hash function.
  Function rsksiSetHashFunction and SetCnfParam updated.
  Thanks to Taavi Väljaots for the patch.
- 2020-04-28: imfile bugfix: poential segfault in stream object on file read
  - if cstrLen(pThis->prevMsgSegment) > maxMsgSize then len calculation
    become negative if cstrLen(thisLine) < cstrLen(pThis->prevMsgSegment)
    This causes illegal access to memory location and thus causing segfault.
  - assigning len = 0 if cstrLen(pThis->prevMsgSegment) > maxMsgSize so that
    it access the correct memory location.
  Thanks to github user jaankit
- 2020-04-28: openssl TLS drivers: made more reliable for older openssl versions
  OpenSSL can retry some failed operations, but older versions need an explicit
  opt-in to do so. This is now done.
- 2020-04-28: omprog: fix bad fd errors in daemon mode
  When omprog was used with the 'forceSingleInstance=on' option, and/or
  the 'output' setting, "bad file descriptor" errors occurred, which
  prevented the external program to be executed and/or the program output
  to be correctly captured. The bug could also manifest as "resource
  temporarily unavailable" errors, or other errors related to the use of
  invalid/reassigned file descriptors. These errors only happened when
  rsyslog ran in daemon mode (i.e. they didn't happen if rsyslogd was
  run with the '-n' option).
  The cause of the bug was that omprog opened the pipe fds needed by
  these flags during the configuration load phase (in the 'newActInst'
  module entrypoint). This is a bad place since the fork of the daemon
  occurs after this phase, and all fds are closed when the daemon process
  is started (see 'initAll' in rsyslogd.c), hence invalidating the
  previously opened fds.
  To correct this, the single child process and the output capture thread
  are now started later, when the first log message is received by the
  first worker thread. (Note: the 'activateCnf' module entrypoint, despite
  being invoked after the fork, cannot be used for this purpose, since it
  is invoked per module, not per action instance.)
  Currently no automated test exists for this use case since the testbench
  always runs rsyslog in non-daemon mode.
  Affected versions: v8.38 and later
  closes: https://github.com/rsyslog/rsyslog/issues/4247
  Thanks to Joan Sala Isern for the patch.
- 2020-04-28: omfile bugfix: $outchannel split log lines at rotation time
- 2020-04-17: openssl: add support for libreSSL
  Disable use of "@SECLEVEL" in default cipher string and
  avoid SSL_CONF_CTX_set_flags() API when LIBRESSL is used.
  This means tlscommands will not work.
  closes: https://github.com/rsyslog/rsyslog/issues/4210
- 2020-03-04: imudp bugfix: build problems on some Linux kernel versions
  Thanks to Wen Yang for the patch.
- 2020-03-02: conf output bugfix: -o produces missing space between call and rulename
  Thanks to Tetiana Ohnieva for the patch.
  closes https://github.com/rsyslog/rsyslog/issues/3761
----------------------------------------------------------------------------------------
Scheduled Release 8.2002.0 (aka 2020.02) 2020-02-25
- 2020-02-25: imfile: add per minute rate limiting
  Add MaxBytesPerMinute and MaxLinesPerMinute options.
  These take integer values and, respectively, limit the number
  of bytes or lines that may be sent in a minute.
  This can be used to put a limit on the count or volume of logs
  that may be sent for an imfile.
  Thanks to Greg Farrell for the patch.
- 2020-02-24: core: add global parameter "security.abortOnIDResolutionFail"
  This parameter controls whether or not rsyslog aborts when a name ID
  lookup fails (for user and group names). This is necessary as a security
  measure, as otherwise the wrong permissions can be assigned or privileges
  are not dropped.
  CHANGE OF BEHAVIOR
  The default for this parameter is "on". In previous versions, the default
  was "off" (by virtue of this parameter not existing). As such, existing
  configurations may now error out.
  We have decided to accept this change of behavior because of the potential
  security implications.
  closes https://github.com/rsyslog/rsyslog/issues/4164
- 2020-02-24: openssl TLS driver bugfix: chained certificates were not accepted
  This was supported since always inside GnuTLS driver, but was missing for openssl one.
- 2020-02-24: core bugfix: too early parsing of incoming messages
  In theory, rsyslog should call parsers on the queue worker threads whenever
  possible. This enables the parsers to be executed in parallel. There are
  some cases where parsers needs to be called earlier, namely when parsed
  data is needed for rate-limiting.
  The logic to do this previously did not work correctly and was fixed six
  years ago (!) by b51dd22. Unfortunately, b51dd22 was overly agressive:
  it actually makes the early parser call now mandatory, effectively moving
  parsing to the input side where there is no to little concurrency.
  We still do not need to call the parser when all messages, regardless of
  severity, need to be rate-limited. This is the default and very frequent
  case. This patch introduces support for this and as such makes parsers
  able to run in parallel in the frequent case again.
  closes https://github.com/rsyslog/rsyslog/issues/4187
- 2020-02-20: testbench bugfix: two minor issues in omkafkadynakey.sh test
  lead to false positives during test runs (depending on circumstances)
  closes: https://github.com/rsyslog/rsyslog/issues/4134
- 2020-02-20: testbench: set max extra data length for tcpflood from 200 to 512KiB
  Added a imrelp test for big messages (256KB).
  closes: https://github.com/rsyslog/rsyslog/issues/4158
- 2020-02-20: config system bugfix: 'config.enabled' directive oddities
  Previously the directive was processed way too late which caused false
  errors whenever it was set to 'off' and possibly other problems.
  Thanks to Jiri Vymazal for the patch.
- 2020-02-09: imfile bugfix: timeout did not work on very busy system
  The timeout feature was soley based on timeouts of the poll()
  system call. On a very busy system, this would probably happen
  very seldomly.  Moreover, the timeout could occur later than
  expected on any system with high load.
  The issue was not reported from practice but discovered during
  CI system improvements.
- 2020-01-30: build system: change --enable-imfile-tests default to "yes"
  This was accidentally set to "no" some time ago (actual commit unknown). Tests for
  imfile should by default run when imfile is enabled.
  see also https://github.com/rsyslog/rsyslog/issues/4120
- 2020-01-27: build system: add option --enable-gnutls-tests
  This enables us to build GNUtls support but not necessarily
  test it in CI. This is useful for some specialised subcomponent
  test. The default is enabled if gnutls is enabled and disabled if not.
- 2020-01-26: testbench: new test for loadbalancing via global vars
  This is a popular functionality which had not been routinely tested
  in the past.
- 2020-01-26: mmdblookup bugfix: invalid data returned when no entry found
  Since the upgrade of the package libmaxminddb on FreeBSD (1.3.2_2 -> 1.4.2),
  the module mmdblookup returns the first entry of the mmdb database even if the entry
  is not found. After some debug, I found the solution in the official maxminddb
  repository : to check if the entry is in database, we must check the found_entry
  attribute, otherwise the function MMDB_get_entry_data_list will return the first
  entry of the database if the entry is not found in it.
  Thanks to Kevin Guillemot for the patch.
- 2020-01-23: oversize message log bugfix: do not close fd -1
  The oversize message log fd is always closed on HUP, even if it never
  was opened (and thus has -1 value). This patch corrects the issue.
  The bug had no know-bad effect in practice other than getting an
  (ignored) error status from close(). However, it introduced warnings
  in test runs (e.g. when running under valgrind).
- 2020-01-22: imfile bugfix: saving of old file_id for statefiles
  Previously we saved old file_id unconditionally, which led to not
  deleting old statefiles if files changes without rsyslog running.
  Now it should work correctly.
  Thanks to Jiri Vymazal for the patch.
- 2020-01-22: imfile bugfix: misadressing and potential segfault
  Commit 3f72e8c introduced an invalid memory allocation size. This lead to
  too-short alloc and thus to overwrite of non-owned memory. That in turn
  could lead to segfaults or other hard to find problems.
  The issue was detected by our upgraded CI system. We did not receive
  any problem reports in practice. Nevertheless, the problem is real and
  people should update affected versions to patched ones.
  The bug was present in scheduled stable release 8.1911.0 and 8.2001.0.
  see also: https://github.com/rsyslog/rsyslog/issues/4120
  see also: https://github.com/rsyslog/rsyslog/pull/4141
- 2020-01-20: core bugfix: potential race during HUP
  when rsyslog is HUPed immediately after startup and before it is fully
  initialized, there is a potential race with the list of loaded modules.
  This patch ensures no bad things can happen in that case.
  Detected by LLVM TSAN, not seen in practice.
- 2020-01-20: testbench improvements and fixes
  modernize tests, reduce robustness against slow machines, provide some
  test framework functional enhancements, and optimize some tests.
  Also includes some code changes to C testing components. Among others,
  tests have slightly been speeded up by reducing the wait time at queue
  shutdown. This is possible because of better overall completion checks.
----------------------------------------------------------------------------------------
Scheduled Release 8.2001.0 (aka 2020.01) 2020-01-14
- 2020-01-12: core bugfix: race condition related to libfastjson when using DA queue
  Rsyslogd aborts when writing to disk queue from multiple workers simultaneously.
  It is assumed that libfastjson is not thread-safe.
  Resolve libfastjson race condition when writing to disk queue.
  see also https://github.com/rsyslog/rsyslog/issues/4041
  Thanks to MIZUTA Takeshi for the fix.
- 2020-01-12: omfwd bugfix: parameter streamdriver.permitexpiredcerts did not work
  closes https://github.com/rsyslog/rsyslog/issues/4098
- 2020-01-11: Bugfix: KSI module + dynafile in asynchronous mode fixed
  Thanks to Taavi Valjaots for the patch
- 2020-01-08: tls driver: add support to configure certificate verify depth
  Support added in omfwd as instance parameter:
  streamdriver.TlsVerifyDepth
  Support added in imtcp as module parameter:
  streamdriver.TlsVerifyDepth
  Can be 2 or higher.
  Support added into ossl driver
  Support added into gtls driver
  Added testcases for both drivers.
  closes: https://github.com/rsyslog/rsyslog/issues/4035
- 2020-01-08: modernization of testbench
  moved some tests to newer standards, hardened them against slow testbench machines,
  kafka component download improvements, and prevent dangling left-over test tool
  instances from aborted tests
- 2020-01-07: tls subsystem bugfix: default for permitExpiredCerts was invalidly "on"
  The problem occurred with commit 3d9b8df in December 2018 and went into
  scheduled stable 8.1901.0. Unfortunately, the change in default was not detected
  until a year later. This commit re-enables the previous default ("off"), which is
  also the only sensible default from a security PoV. Unfortunately, new 2019
  deployments may begin to see connection rejection when usin expired certs. As
  expired certs should not be used, this hopefully will not cause problems in
  practice.
  Thanks to Jiri Vymazal for the patch.
- 2020-01-01: testbench: improve ElasticSearch test speed
  We now support re-using suitable running ES instances, which reduces the
  number of restarts.
- 2019-12-31: omelasticsearch: improve curl reply buffer handling
  The curl reply buffer (pWrkrData->reply) was allocated, realloced and freed with
  each request. This has now been reduced to once per module, slightly increasing
  overall performance.
  closes https://github.com/rsyslog/rsyslog/issues/1964
- 2019-12-31: config system: emit proper error message on $ in double-quoted string
  closes https://github.com/rsyslog/rsyslog/issues/2869
- 2019-12-30: core bugfix: rsyslog aborts when config parse error is detected
  In defaut settings, rsyslog tries to continue to run, but some data
  structures are not properly initialized due to the config parsing error.
  This causes a segfault.
  In the following tracker, this is the root cause of the abort:
  see also https://github.com/rsyslog/rsyslog/issues/2869
- 2019-12-30: fix some alignment issues
  So far, this worked everywhere (for years). But it may still have
  caused issues on some platforms.
  closes https://github.com/rsyslog/rsyslog/issues/2608
- 2019-12-27: core bugfix: APP-NAME fields could become empty
  RFC 5424 specifies that an empty APP-NAME needs to be indicated by
  "-". Instead, the field could become empty under certain conditions.
  If so, outgoing 5424 messages were invalidly formatted.
  This happened under quite unusual conditions, but could be seen
  in practice.
  closes https://github.com/rsyslog/rsyslog/issues/4043
- 2019-12-27: core bugfix: reopen /dev/urandom file descriptor after fork on Linux
  This patch updates prepareBackground() in tools/rsyslogd.c to reopen any file
  descriptors used for random number generation in the child process. This fixes
  an issue on Linux systems where the file descriptor obtained for /dev/urandom
  by seedRandomNumber() in runtime/srutils.c was left closed after the fork. This
  could be observed in procfs, where /proc/fd/ would show no open descriptors to
  /dev/urandom in the forked process. /dev/urandom is reopened as the child may be
  be operating in a jail, and so should not continue to use file descriptors from
  outside the jail (i.e. inherited from the parent process).
  I found that this issue led to rsyslog intermittently hanging during seedIV()
  in runtime/libgcry.c. After the fork, the closed file descriptor number tended
  to get re-assigned. randomNumber() would then read from an incorrect (although
  still valid) file descriptor, and could block (depending on the state of that
  file descriptor). This gave rise to the intermittent hang that I observed.
  Thanks to Simon Haggett for the patch.
- 2019-12-20: imdocker bugfix: did not compile without atomic operations
- 2019-12-20: omclickhouse: new parameter "timeout"
  Thanks to Pavlo Bashynskiy for the patch.
- 2019-12-20: omhiredis: add 'set' mode plus some fixes
  - new mode 'set' to send SET/SETEX commands
  - new parameter 'expiration' to send SETEX instead of SET commands (only applicable to 'set' mode)
  - fixes to missing frees
  Thanks to github user frikilax for the patch.
- 2019-12-18: relp: Add support setting openssl configuration commands.
  Add new configuration parameter tls.tlscfgcmd to omrelp and imrelp.
  (Using relpSrvSetTlsConfigCmd and relpCltSetTlsConfigCmd)
  OpenSSL Version 1.0.2 or higher is required for this feature.
  A list of possible commands and their valid values can be found in the
  documentation: https://www.openssl.org/docs/man1.0.2/man3/SSL_CONF_cmd.html
  The setting can be single or multiline, each configuration command is
  separated by linefeed (n). Command and value are separated by
  equal sign (=). Here are a few samples:
  tls.tlscfgcmd="Protocol=ALL,-SSLv2,-SSLv3,-TLSv1,-TLSv1.2"
  tls.tlscfgcmd="Protocol=ALL,-SSLv2,-SSLv3,-TLSv1
  MinProtocol=TLSv1.2"
  Add to new testcases for librelp and tlscfgcmd.
  closes https://github.com/rsyslog/rsyslog/issues/3959
- 2019-12-18: bugfix core: potential segfault in template engine
  under some circumstances (not entirely clear right now), memory
  was freed but later re-used as state-tracking structures were not
  properly maintained. Github issue mentioned below has full details.
  Thanks to github user snaix for analyzing this issue and providing
  a patch. I am committing as myself as snaix did not disclose his or
  her identity.
  closes https://github.com/rsyslog/rsyslog/issues/3019
  closes https://github.com/rsyslog/rsyslog/issues/4040
- 2019-12-18: fixed some minor issues detected by clang static analyzer 9
- 2019-12-10: core/config bugfix: false error msg when config.enabled="on" is used
  When the 'config.enabled="on"' config parameter an invalid error message
  was emitted that this parameter is not supported. However, it was still
  applied properly. This commit removes the invalid error message.
  closes https://github.com/rsyslog/rsyslog/issues/4011
- 2019-12-03: omsnmp bugfix: "traptype" parameter invalidly rejected value 6
  "Traptype" needs to support values 0 to 6.
  However, if value 6(ENTERPRISESPECIFIC) was set, an invalid error message
  was emitted. Otherwise processing was correct.
  This could lead to problems with automatic config deployment,
  as valid configurations were invalidly reported as incorrect.
  That in turn could make a deployment fail.
  closes https://github.com/rsyslog/rsyslog/issues/3973
- 2019-12-03: omsnmp: add new parameter "snmpv1dynsource"
  If set, the source field from SNMPv1 trap can be overwritten
  with a template, default is "%fromhost-ip%". The content should be a
  valid IPv4 Address that can be passed to inet_addr(). If the content
  is not a valid IPv4 Address, the source will not be set.
  closes: https://github.com/rsyslog/rsyslog/issues/3991
- 2019-12-02: imfile bugfix: state file renaming sometimes did not work properly
  Now checking if file-id changes and renaming - cleaning state file
  accordingly and always checking and cleaning old inode-only style
  state files.
  Thanks to Jiri Vymazal for the patch.
- 2019-12-02: ratelimit: increase rate limit interval parameter max value
  The burst parameter in the ratelimit was increased to an unsigned int
  but the interval remained an unsigned short. While it may be unusual,
  there is possibly a chance to need to represent an interval longer than
  about 3/4 of a day.
  While here, go through and normalize all the various incarnations of
  rate limiting to be explicitly unsigned int for the burst and interval.
  Thanks to github user frikilax for the patch.
- 2019-12-02: ommongodb: Add other supported formats for 'time' and 'date' fields
  Thanks to github user frikilax for the patch.
- 2019-12-02: imjournal bugfix: too many messages in error case
  Under certain error conditions, `ignorePreviousMessages="on"` could be ignored
  an existing messages be processed.
  Thanks to github user 3chas3 for the patch.
- 2019-11-27: core bugfix: action on retry mangles messages
  When a failed action goes into retry, template content is rendered
  invalid if the action uses more than 1 template.
  closes https://github.com/rsyslog/rsyslog/issues/3898
  Thanks to Mikko Kortelainen for the patch.
- 2019-11-27: testbench: improve mysql testing support
  tests can now run in parallel and are hardened against several glitches
- 2019-11-22: omhttp: add basic support for Loki Rest
  Loki is a new message indexer and querier from Grafana Labs. See
  https://github.com/grafana/loki for details on Loki.
  This change provides the initial message structure to send bulk message
  payloads to the Loki Rest endpoint. omhttp, received a new bulk message
  format called lokirest. Additionally, the plugin relies on the user to
  provide the correct "stream" read message format.
  A loki template must be json compatible and include a "stream" key of
  key value tags, and a values key of an array of 2 element arrays, where
  each 2 element array is the unix epoch in nanoseconds followed by an
  unstructured message.
  An example:
      template(name="array_loki" type="string" string="{\"stream\":{\"host\":\"%HOSTNAME%\",\"facility\":\"%syslogfacility-text%\",\"priority\":\"%syslogpriority-text%\",\"syslogtag\":\"%syslogtag%\"},\"values\": [[ \"%timegenerated:::date-unixtimestamp%000000000\", \"%msg%\" ]]}")
- 2019-11-22: testbench: obtain python binary path via AM_PATH_PYTHON
  see also https://github.com/rsyslog/rsyslog/issues/3853
- 2019-11-22: omprog: detect violation of interface protocol
  The spec for the omprog interaction with the program it calls specifies
  that the program receives one message via one line. In other words:
  it must be a string terminated by LF.
  However, omprog does currently rely on a proper template to fulfill this
  requirement, If the template does not provide for the LF, it is never
  written. For the called program, this looks like it does not receive any
  input at all. Even if it finally reads data (e.g. due to full buffer),
  it will not properly be able to discern the messages.
  This handling is improved with this commit.
  We cannot just check the template, because at the end of the template
  may by a non-constant value. As such, we do not know at config load
  time if there is this problem or not.
  So the correct approach is to, during runtime, check if each message
  is properly terminated. For those that are not:
  * we append a LF, because anything else makes matters worse
  * log a warning message, at least for a sample of the messages
  The warning is useful in the (expected most often) case that the template
  is simply missing the LF. While appending works, it slows down processing.
  As such the user should be given a chance to correct the config bug.
  To avoid clutter, the warning is emitted at most once every 30 seconds.
  This value is hardcoded as we do not envision a need to adjust it. Usually
  users should quickly fix the template.
  closes https://github.com/rsyslog/rsyslog/issues/3975
- 2019-11-19: core queue: emit warning if parameters are set for direct queue
  Direct queues do not apply queue parameters because they are actually
  no physical queue. As such, any parameter set is ignored. This can
  lead to unintentional results.
  The new code detects this case and warns the user.
  closes https://github.com/rsyslog/rsyslog/issues/77
- 2019-11-19: imjournal bugfix: do not wait too long on recovery try
  When trying to recover journal errors, imjournal waited a hardcoded
  period of 10s between tries. This was pretty long and could lead to
  loss of journal data.
  This commit adjust it to 100ms, which should still be fully sufficient
  to prevent the journal from "hammering" the CPU.
  It may be worth considering to make this setting configurable - but
  let's first see if there is real demand to actually do that.
  closes https://github.com/rsyslog/rsyslog/issues/3969
- 2019-11-19: mmutf8fix: enhance handling of incorrect UTF-8 sequences
  1. Invalid utf8 detection didn't handle 3 and 4-byte overlong encodings (2
     byte overlong encodings were handled explicitly by rejection E0 and E1
     start bytes). Unified checks for overlong encodings.
  2. Surrogates U+D800..U+DFFF are not valid codepoints (Unicode Standard, D92)
  3. Replacement of characters in invalid 3 or 4-bytes encodings was too
     eager. It must not replace bytes which are valid UTF-8 sequences. For
     example, in [0xE0 0xC2 0xA7] sequence the 0xC2 is invalid as a continuation
     byte, but it starts a valid UTF8 symbol [0xC2 0xA7]. That is, with current
     code processing the sequence will result in "???" but the correct result is "?§"
     (provided that the replacement character is "?").
  4. Various tests for UTF-8 invalid/valid sequences.
  Thanks to Sergei Turchanov for the patch.
- 2019-11-14: imfile: add new input parameter escapeLF.replacement
  The new parameter permits to specify a replacement to be configured
  when "escapeLF" is set to "on". Previously, a fixed replacement string
  was used ("#012"/"\n") depending on circumstances. If the parameter is
  set to an empty string, the LF is simply discarded.
  closes https://github.com/rsyslog/rsyslog/issues/3889
----------------------------------------------------------------------------------------
Scheduled Release 8.1911.0 (aka 2019.11) 2019-11-12
- 2019-11-12: core queue: add config param "queue.takeFlowCtlFromMsg"
  This is a fine-tuning option which permits to control whether or not
  rsyslog shall alays take the flow control setting from the message. If
  so, non-primary queues may also block when reaching high water mark.
  This permits to add some synchronous processing to rsyslog core engine.
  However, it is dangerous, as improper use may make the core engine
  stall. As such, enabling this option requires very careful planning
  of the rsyslog configuration and deep understanding of the consequences.
  Note that the option is applied to individual queues, so a configuration
  with a large number of queues can (and must if use) be fine-tuned to
  the exact use case.
  The rsyslog team strongly recommends to let the option turned off,
  which is the default setting.
  see also https://github.com/rsyslog/rsyslog/issues/3941
- 2019-11-12: imrelp: add new config parameter "flowcontrol"
  This permits to fine-tune the flowControl parameter. Possible values are
  "no", "light", and "full". With light being the default and previously
  only value.
  Changing the flow control setting may be useful for some rare applications,
  but be sure to know exactly what you are doing when changing this setting.
  Most importantly, whole rsyslog may block and become unresponsive if you
  change flowcontrol to "full". While this may be a desired effect when
  intentionally trying to make it most unlikely that rsyslog needs to
  lose/discard messages, usually this is not what you want.
  see also https://github.com/rsyslog/rsyslog/issues/3941
- 2019-11-11: imrelp: remove unsafe debug instrumentation
  dbgprintf, which is not signal safe, was called from a signal handler
  to get better understanding during debugging. While this usually works,
  it can occasionally (5%) lead to a hang during shutdown. We have now
  removed that debug info as it is no longer vital.
  Note: this could only happen during debug runs. Production mode was
  not affected. As such, this fix is only relevant to developers.
  However, it caused some confusion in the following issue tracker.
  see also https://github.com/rsyslog/rsyslog/issues/3941
- 2019-11-06: ossl driver bugfix: fix wrong OpenSSL Version check
  Fix OpenSSL Version check in:
  - SetGnutlsPriorityString function in nsd_ossl.c
  - initTLS() function tcpflood.c
  See https://www.openssl.org/docs/man1.1.0/man3/OPENSSL_VERSION_NUMBER.html
  for more.
  This bug lead to not enabling some functionality correctly.
  Removed "MinProtocol=TLSv1.1" from two testcases because MinProtocol
  is only supported by OpenSSl 1.1.0 or higher and was not really
  necessary for the testcases.
  closes https://github.com/rsyslog/rsyslog/issues/3939
- 2019-11-05: mmdarwin: Optimizations, new parameters, update to protocol header
  - use permanent worker-dependent buffers to avoid malloc/free for each entry
  - move socket structures to worker data, remove global mutex
  - add log lines for parameters and general workflow
  - don't send body if empty/incomplete (see new parameters)
  - don't close/reopen socket every time -> let session open or create new every X
    entry (see new parameters)
  - clean up code
  - added 'send_partial', to let mmdarwin send body if not all fields were
    retrieved, or not; default false = only send complete bodies
  - added 'socket_max_use' to open new session every X packet, useful for
    some versions of Darwin (prior to 1.1)
    default is 0 = do not open new session/keep only one
  - added 'evt_id' to the darwin header (Darwin v1+ compatibility)
  Note: mmdarwin is a contributed module
  Thanks to github user frikilax for the patch.
- 2019-11-01: mmkubernetes bugfix: improper use of realloc()
  could cause problems under extreme memory shortage - very unlikely
  credits to LGTM.COM for detecting this
- 2019-10-31: imjournal: set the journal data threshold to MaxMessageSize
  When data is read from the journal using sd_journal_get_data it may be
  truncated to a certain threshold (64K by default).
  If the rsyslog MaxMessageSize is larger than the threshold, there is a
  chance rsyslog will receive incomplete messages from the journal.
  Empirically, this appears to happen reliably when XZ compression is
  used by journald. Systems where journald uses LZ4 compression do not
  appear to suffer this issue reliably--if at all.
  This change sets the threshold to the MaxMessageSize when the
  journal is opened.
  Thanks to Robert Winslow Dalpe for the patch.
- 2019-10-30: improg bugfix: allow improg to handle multi-line inputs
  miscellaneous bug fixes in improg:
  * properly truncate string after an input event is submitted
  * set msgoffset to 0.
  * tests added to check above fixes
  Thanks to Nelson Yen for the fix.
- 2019-10-30: mmdblookup bugfix: missing space in city name
  This fixes the issue that spaces in city names are dropped. However, the
  fix is more or less a work-around. As it turns out, the libmaxminddb API
  is not correctly used. In the somewhat longer term, we should fix this.
  see also https://github.com/maxmind/libmaxminddb/issues/218
  closes https://github.com/rsyslog/rsyslog/issues/1650
- 2019-10-30: core/queue: provide ability to run diskqueue on multiple threads
  Up until this release, disk queues could only use a single thread,
  what limited their performance with outputs like ElasticSearch.
  Now disk queues can utilize multiple threads just like any other
  queue type. Most importantly, the disk queue part of a DA queue
  now inherits the max number of threads from its memory queue
  counterpart.
  NOTE: the new multi-threaded DA disk queue is actually a change of
  behavior. We have not guarded it by a new config switch as we
  assume the new behavior is most often exactly within user
  expectations. In any case, we cannot see any harm from running
  the disk queue on multiple threads.
  see also https://github.com/rsyslog/rsyslog/issues/3543
  closes https://github.com/rsyslog/rsyslog/issues/3833
- 2019-10-25: omfile bugfix: file handle leak
  The stream class does not close re-opened file descriptors.
  This lead to leaking file handles and ultimately to the inability
  to open any files/sockets/etc as rsyslog ran out of handles.
  The bug was depending on timing. This involved different OS
  thread scheduler timing as well as workload. The bug was more
  common under the following conditions:
  - async writing of files
  - dynafiles
  - not committing file data at end of transaction
  However it could be triggered under other conditions as well.
  The refactoring done in 8.1908 increased the likelihood of
  experiencing this bug. But it was not a real regression, the new
  code was valid, but changed the timing so that the race was more
  likely.
  Thanks to Michael Biebl for reporting this bug and helping to
  analyze it.
  closes https://github.com/rsyslog/rsyslog/issues/3885
- 2019-10-22: imfile bugfix: improper use of calloc()
  could cause problems under extreme memory shortage - very unlikely
  credits to LGTM.COM for detecting this
- 2019-10-22: TLS driver bugfix: improper use of calloc()
  can cause problems under extreme memory shortage - very unlikely
  credits to LGTM.COM for detecting this
- 2019-10-22: imuxsock  bugfix: improper use of calloc()
  can cause problems under extreme memory shortage - very unlikely
  credits to LGTM.COM for detecting this
- 2019-10-17: build system bugfix: incorrect default in ./configure help text
  closes https://github.com/rsyslog/rsyslog/issues/3904
  Thanks to Michael Biebl for pointing this out.
- 2019-10-17: mmkubernetes bugfix: improper use of calloc()
  can cause problems under extreme memory shortage - very unlikely
  credits to LGTM.COM for detecting this
- 2019-10-16: core queue bugfix: propagate batch size to DA queue
   This was a long-standing bug where the DA queue always had a fixed small batch
   size because the setting was not propagated from the memory queue. This also
   removes a needless and counter-productive "debug aid" which seemed to be in
   the code for quite some while. It did not cause harm because of the batch
   size issue.
- 2019-10-16: testbench: fix unreliable gzipwrite test
  The test was timing-sensitive as we did not properly check all data
  was output to the output file - we just relied on sleep periods.
  This has been changed. Also, we made some changes to the testing
  framework to fully support sequence checking of multiple ZIP files.
- 2019-10-16: core queue bugfix: handle multi-queue-file delete correctly
  Rsyslog may leave some dangling disk queue files under the following
  conditions:
  - batch sizes and/or messages are large
  - queue files are comparatively small
  - a batch spans more than two queue files (from n to n+m with m>1)
  In this case, queue files n+1 to (n+m-1) are not deleted. This can
  lead to problems when the queue is re-opened again. In extreme cases
  this can also lead to stalled processing when the max disk space is
  used up by such left-over queue files.
  Using defaults this scenario is very unlikely, but it can happen,
  especially when large messages are being processed.
- 2019-10-16: imjournal: fix regression from yesterday's patch
  commit 78976a9bc059 introduced a regression that caused writing
  the journal state file to fail. This happens when the state file
  is given as relative file name and the working directory is also
  a relative path. This situation is very uncommon. So most deployments
  will never experience it. We discovered the issue during CI runs
  where the trigger condition is given. Note that it also takes
  multiple times of loading the journal to actually see the bug.
  see also https://github.com/rsyslog/rsyslog/pull/3878
- 2019-10-15: imjournal plugin code restructuring, added remote option
  Decomposed ReadJournal() a bit, also now coupling journald
  variables in one struct, added few warning messages and debug
  prints to help with bug hunts in future, also got rid of two
  needless journald calls. WorkAroundJournalBug now deprecated.
  Added option to pull journald records from outside local machine.
  Thanks to Jiri Vymazal for the patch.
- 2019-10-11: core bugfix: potential abort on very long action name
  The action name is stored in modified form for the debug header and
  some messages. If it is extremely long, a buffer can be overrun,
  resulting in misaddressing and potential segfault for rsyslog. This
  can also happen if the action is NOT named, but a custom path to
  the output module is given and that path is very long. This triggers
  the same issue because by default the module load path is included
  in the action name.
  This patch corrects the problem and truncates overly long names
  when being used for name generation.
  The problem was detected during testbench work. We did never receive
  a bug report from practice.
- 2019-10-10: testbench: add test for mmpstrucdata with RFC5424 escape sequences
----------------------------------------------------------------------------------------
Scheduled Release 8.1910.0 (aka 2019.10) 2019-10-01
- 2019-10-01: core bugfix: incorrect error message on duplicate module load
  A Null-pointer was passed to printf instead of the module name.
  On some platforms this may lead to a segfault. On most platforms
  printf check's for NULL pointers and uses the string "(null)"
  instead.  In any case, the module name is missing from the error message.
- 2019-10-01: imczmq nitfix: potential NULL ptr in printf on out-of-memory condition
  very unlikely to happen but if it does without any real issue on most platforms.
- 2019-10-01: work around some compiler warning messages induced by pthreads API
- 2019-10-01: core ratelimiting: more verbose message when rate-limiting happens
  When messages are rate-limited, the error message now also contains the
  rate limiter setting. This enables the user to more quickly understand what
  the problem is (especially if default values apply).
  Thanks to Jiri Vymazal for the patch.
- 2019-10-01: openssl TLS driver: do not emit unnecessary error message
  On older openssl versions, an API was missing to set user-defined parameters. If we
  had such an older version, rsyslog emitted an error message even if the user did
  not configure such parameters. This has been corrected, so that a message is only
  emitted if there really is a problem. Based on user feedback the severity has also
  been downgraded to "warning".
- 2019-10-01: pmcisconames (contributed module) bugfix: potential misaddressing
- 2019-09-30: pmaixforwardedfrom (contributed module) bugfix: potential misaddressing
- 2019-09-30: pmdb2diag (contributed module) bugfix: Out of bounds issue
  Add a new sanity check after determining the level len.
  Thanks to Philippe Duveau for the patch.
  see also: https://nvd.nist.gov/vuln/detail/CVE-2019-17040
- 2019-09-02: ability to set stricter TLS operation modes
  - checking of extendedKeyUsage certificate field
  - stricter checking of certificate name/addresses
  Thanks to Jiri Vymazal for the patch.
- 2019-08-21: testbench: add basic test for immark
- 2019-08-20: core: do not unnecessarily set hostname on each HUP
- 2019-08-20: build system: support cross-platform build for mysql/mariadb
  rsyslog fails to cross build from source, because it uses mysql_config
  and mysql_config is unfixably broken for cross compilation. It would be
  better to use pkg-config. The attached patch makes rsyslog try
  pkg-config first and fall back to mysql_config.
  Thanks to Helmut Grohne for providing a base patch.
- 2019-08-20: core/tcpsrv: potential race on startup/shutdown
  if the tcpsrv component is started and quickly terminated, it may hang
  for a short period of time. Also a very small amount of memory is leaked
  immediately before shutdown. While this leak is irrelevant in practice
  (the OS clean up the process anyways), it leads to CI failures. The hang,
  however, can lead to longer than expected shutdown times for rsyslog.
  The problem can be experienced via imtcp, imgssapi and imdiag (users
  of affected core component).
----------------------------------------------------------------------------------------
Scheduled Release 8.1908.0 (aka 2019.08) 2019-08-20
- 2019-08-19: testbench: add test for $allowedSender functionality
- 2019-08-19: testbench: harden some tests against very slow CI machines
- 2019-08-16: testbench: make most tests use a port file and assign listen port 0
  This makes the test much more robust against heavily loaded test systems.
- 2019-08-16: core/action: guard action.externalstate.file content against whitespace
  remove trailing whitespace before checking the status string. This is
  most important as a line usually ends with \n, which is considered
  trailing whitespace. Accepting this increases usability.
- 2019-08-16: imtcp bugfix: multiple listenerPortFile parameter did not work
  ... because they were treated as module-global. If we had multiple imtcp
  listeners with multiple port files, only the last filename was always used.
  closes https://github.com/rsyslog/rsyslog/issues/3817
- 2019-08-16: testbench: improve testbench plumbing for gzip and fail cases
  We have added new capabilities to the testbench plumbing to automatically
  deal with gzip-compressed files. This also permits to use the wait_seq_check
  function to work for gzip tests as well. The known-timing-sensitive
  gzipwr_large test now makes use of the new capabilities. This enables us
  to more reliably detect when we can savely shutdown the tested instance.
  This commit also adds an ability to "abort" the full testbench run on
  first test failure. This is especially useful during CI.
- 2019-08-13: testbench: add test for imuxsock legacy format
  This was never tested. Ensures we don't accidentally break existing
  configurations.
- 2019-08-13: omelasticsearch bugfix: segfault on unknown retryRuleset
  omelasticsearch does some "interesting tricks" for an output module.
  This causes a segfault if the retryRuleset is now known.
  The action module interface currently expects that all config errors
  be detected during instance creation. Instead omelasticsearch defers
  the retry ruleset check to a later state. The reason is that it wants
  to support the use the same rulesetname it is defined in - and this
  is not yet available at action parsing.
  We fix this by ensuring that any deleted instance is properly unlinked
  from the instance list. One may argue the module interface should get
  upgrade for such cases, but this is a longer-term approach.
  closes https://github.com/rsyslog/rsyslog/pull/3796
- 2019-08-12: imptcp bugfix: port="0" parameter did not work as expected
  when multiple interfaces and/or protocols could be bound, each of
  them used a different listener ports were assigned. While this is
  basically correct, it makes things unusable, especially as
  listenPortFileName will only contain the port number used for
  the latest listener.
  This patch now follows the model of nsd_ptcp.c to assign only
  the first port randomly and then use that port consistently.
- 2019-08-10: omelasticsearch bugfix: potential resource leak with "rebindinterval"
  If the "rebindInterval" parameter was used connections could be linked. This
  was especially the case with small intervals (such as "2"). This is fixed by
  forcing libcurl to close the connection on rebind.
  Thanks to Noriko Hosoi for providing the patch.
- 2019-08-10: imjournal bugfix: state file close with fsync() was incorrect
  This lead to fsync() now always applied where expected.
  Thanks to Jiri Vymazal for the patch.
- 2019-08-10: testbench: add addtl test for multithreading and HUP
- 2019-08-10: imptcp bugfix: received bytes counter improperly maintained
  imptcp counts the number of bytes received. However, receives
  happen on different worker thread. The access to the counter
  was not synchronized, which can cause loss of updates. Also,
  thread debuggers validly flag this as an error, which creates
  problems under CI.
  This commit fixes the situation via atomic operations and
  falls back to mutex calls if they are not available.
  Detected by LLVM thread sanitizer.
  closes https://github.com/rsyslog/rsyslog/issues/3798
- 2019-08-07: testbench: add basic tests for omusrmsg
- 2019-08-05: omhttp bugfix: enable checkpath configuration parameter
  omhttp, 'checkpath' option, was not configurable in the past.
  - add 'checkpath' to the cnfparamdescr table.
  - fix issue with checkpath passing extra garbage characters in string.
  - add 'checkpath' into unit test - omhttp-retry.sh
  Thanks to Nelson Yen for the fix.
- 2019-08-05: testbench bugfix: some tests were executed when req module was missing
  In actual case if --enable-impstats was not given some other tests failed.
- 2019-08-03: iminternal bugfix: race on termination
  This could in theory lead to loss of shutdown messages, but was mostly a
  cosmetic issues. We primarily fixed it to get TSAN-clean so that we can
  utilize LLVM TSAN in CI.
- 2019-08-02: testbench: new test for omfile outchannel functionality
- 2019-08-02: core/janitor bugfix: properly maintain dynafile cache
  When the janitor cleans out timed-out files, it does not
  properly indicate the entry is gone. Especially when running
  in async mode this can lead to use-after-free and thus
  memory corruption or segfault.
  see also https://github.com/rsyslog/rsyslog/issues/3756
- 2019-08-01: omfile bugfix: race file when async writing is enabled
  This seems to be a long-standing bug, introduced around 7 years ago.
  It became more visible by properly closing files during HUP, which
  was done in 8.1905.0 (and was another bugfix). Note that due to this
  race a memory corruption can occur under bad circumstances. As such,
  this may have also caused segfaults or system hangs (mutexes could
  have been affected).
  closes https://github.com/rsyslog/rsyslog/issues/3772
- 2019-08-01: testbench: additional tests for HUP
- 2019-07-31: imrelp bugfix: hang after HUP
  termination condition was not properly checked; this lead to
  premature termination after patch 1c8712415b9 was applied.
  It is open to debate if patch 1c8712415b9 changed the module
  interface. Actually it looks like this was previously not
  well thought out.
  closes https://github.com/rsyslog/rsyslog/issues/3760
- 2019-07-24: mmdarwin: add new module
  This is a contributed module. For details see doc.
  Thanks to the Advens team for contributing it.
- 2019-07-23 iminternal bugfix: suppress mutex double-unlock
  If there is a burst of log messages during a time when rsyslog is unable
  to output (either during log rotation, an out-of-space condition, or
  some other similar condition), rsyslog can SEGFAULT due to a mutex
  double-unlock.
- 2019-07-23 imtcp: enable listenPortFileName parameter
  this parameter was added, but it had no effect as it was not
  passed down to the driver layer. This has been fixed. That also
  now enables us to use dynamically-assigned port, which are
  very useful for further testbench stabilization. Quite some
  false positives occurred because the pre-selected port was
  already in use again when rsyslog started.
- 2019-07-19 imtcp: enable listenPortFileName parameter
  this parameter was added, but it had no effect as it was not
  passed down to the driver layer. This has been fixed. That also
  now enables us to use dynamically-assigned port, which are
  very useful for further testbench stabilization. Quite some
  false positives occurred because the pre-selected port was
  already in use again when rsyslog started.
- 2019-07-18 core/action: no error file written if act suspended on TX commit
  when an action was already disabled while the action was tried to be
  committed, no error file was written. Note that this state is highly
  unlikely to happen. Most probably, it can only happen if parameter
  action.externalstate.file is used.
----------------------------------------------------------------------------------------
Version 8.1907.0 (aka 2019.07) 2019-07-09
NOTE TO MAINTAINERS: libee is not used by rsyslog for quite some while.
However, we never included this info into the changelog. So if you still
make rsyslog depend on libee (some do this), you should stop doing so now.
Libee is dead and no longer been maintained nor hosted by us. Old versions
can still be found at github for those in need.

GENERAL NOTE: during 8.1907 scheduled release timeframe we changed the ChangeLog
format to include the date a change went into master branch. This is to provide
an easy way to identify which changes went into the respective daily stable.

- 2019-07-05 imuxsock: support FreeBSD 12 out of the box
  FreeBSD 12 uses RFC5424 on the system log socket by default. This
  format is not supported by the special parser used in imuxsock.
  Thus for FreeBSD the default needs to be changed to use the
  regular parser chain by default. That is all this commit does.
  closes https://github.com/rsyslog/rsyslog/issues/3694
- 2019-07-05 function bugfix: "ipv42num" misspelled as "ip42mum" (without "v")
  To fix the issue but keep compatible with existing deployments
  both function names are now supported.
  closes https://github.com/rsyslog/rsyslog/issues/3676
- 2019-07-04 fix leading double space in rsyslog startup messages
  see also https://github.com/rsyslog/rsyslog/issues/2979
- omamqp1: port to latest api, add tests
  This brings omamqp1 up-to-date with the latest qpid-proton-c
  api version.  This also adds a test for the plugin, to test
  the basic functionality.  The test requires the user to
  install qdrouterd and the python qpid-proton library in order
  to use the simple_recv.py test program.
  Thanks to Richard Megginson for the patch.
- omclickhouse bugfix: potential segfault on omclickhouse batchmode
  segfault happened when the template did not contain the string
  "VALUES".
  Thanks to github user wdjwxh for the fix.
- core bugfix: message duplication copied incorrect timestamp
  MsgDup() placed timereported into timegenerated property, resulting
  in invalid property values. Original timegenerated was lost. This
  occurred always when a message needed to be duplicated. Most
  importantly this is the case when queues are used.
  closes https://github.com/rsyslog/rsyslog/issues/3716
- core bugfix: segfault on startup depending on queue file names
  rsyslog will segfault on startup when a main queue file name has
  been set and at least on other queue contains a file name. This
  was cased by too-early freeing config error-detection data
  structures. It is a regression caused by commit e22fb205a3.
  Thanks to Wade Simmons for reporting this issue and providing
  detailed analysis. That greatly helps fixing it quickly.
  closes https://github.com/rsyslog/rsyslog/issues/3681
- core "bugfix": alignment issue
  This was not a hard error on current platforms, but a
  to-be-considered compiler warning regarding invalid alignment.
  While it works well on current platforms, alignment issues may
  turn into real issues in future platforms. So we try to fix them
  if possible. As not only a side-effect this resolves compiler
  warnings even on current platforms.
  This fix has some regression potential. If so, the problems
  may occur during IP address resolution.
  see also https://github.com/rsyslog/rsyslog/issues/2608
- omfile bugfix: potential hang/segfault on HUP of dynafile action
  when omfile was HUPed it did not sufficiently clear all dynafile
  cache maintenance data structures. This usually lead to misaddressing
  and could result in various issues, including a hang of rsyslog
  processing or segfaults. It could also have "no effect" by pure
  luck of not hitting anything important. This actually seems to
  have been the most frequent case.
  This seems to be a long-standing bug, but the likelihood of its
  appearance seems to have been increased by commit 62fbef7
  introduced in 8.1905. Note: the commit itself has no regression,
  just increases the likelihood to trigger the pre-existing bug.
  special thanks to Alexandre Guédon for his help in analyzing
  the issue - without him, we would probably still not know
  what actually went wrong.
  closes https://github.com/rsyslog/rsyslog/issues/3686
- imjournal bugfix: potential message duplication
  When journal was preloaded from previously saved cursor it was not advanced
  to next entry so reading begun from last message which was therefore
  duplicated.
  Thanks to Jiri Vymazal for the patch.
- rfc5424 parser bugfix: leading space sometimes lost
  if structured data is present a leading space in MSG field is lost
- queue subsystem bugfix: oversize queue warning message shown as error
  The warning message was emitted as an error message, which is misleading
  and may also break some automated procedures.
- core bugfix: HUP did not work reliable on all platforms
  most notably not on FreeBSD, maybe others. The reason was obviously
  different handling of signals in respect to multiple threads.
- build system bugfix: missing files in distribution tarball
- testbench
  * fixed "make distcheck" settings which were missing some modules
    This lead to incomplete "make distcheck" run; some errors were not
    detected due to that.
  * testbench framework: use ip tool instead of outdated ifconfig
    The framework now first checks if "ip" is available and falls back
    to "ifconfig" only if this is not the case.
    Thanks to Michael Biebl for the suggestion.
    closes https://github.com/rsyslog/rsyslog/issues/3682
------------------------------------------------------------------------------
Version 8.1905.0 (aka 2019.05) 2019-05-28
- templates: add datatype template option for JSON generation
  The new "datatype" and "onEmpty"  template options permits to
  generate non-string data rather easily. It works together with
  jsonf formatting, which is what people should use nowadays.
  closes https://github.com/rsyslog/rsyslog/issues/2827
- config processing: check disk queue file is unique
  If the same name is specified for multiple queues, the queue files
  will become corrupted. This commit adds a check during config parsing.
  If duplicate names are detected the config parser errors out and the
  related object is not created.
  Note: this may look to a change-of-behavior to some users. However,
  this never worked and it was pure luck that these users did not run
  into big problems (e.g. DA queues were never going to disk at the
  same time). So it is acceptable to error out in this hard error case.
  closes https://github.com/rsyslog/rsyslog/issues/1385
- global config: new parameters for ruleset queue defaults
  specifically:
  * default.ruleset.queue.timeoutshutdown
  * default.ruleset.queue.timeoutactioncompletion
  * default.ruleset.queue.timeoutenqueue
  * default.ruleset.queue.timeoutworkerthreadshutdown
  closes https://github.com/rsyslog/rsyslog/issues/3656
- add capability to write full config file (-o cmdline option)
  Introduces the capability to create an output config file that explodes
  all "includes" into a single file. This provides a much better overview
  of how exactly the configuration is crafted. That could often be a great
  troubleshooting aid.
  This commit also contains some slight not-really-related cleanup.
  closes https://github.com/rsyslog/rsyslog/issues/3634
- queue subsystem: permit to disable "light delay mark"
  New semantic: if lightDelayMark is 0, it is set to the max queue
  size, effectively disabling the "light delay" functionality.
  Thanks to Yury Bushmelev to mentioning issues related to light
  delay mark and proposing the solution (which actually is what
  this commit does).
  closes https://github.com/rsyslog/rsyslog/issues/1778
- queue subsystem: provide better user status messages
  The queue subsystem now provides additional information messages which
  may help a regular user to maintain system health. Most importantly,
  DA queues now output when they persist queue data at end of run and
  when they restart the queue based on persisted data.
- core: emit a warning message for ultra-large queue size definitions
  We see error reports from users who have configured excessively large queues
  and receive an OOM condition or other problems.
  With that patch we generate a warning message if a queue is configured very
  large. "Very large" is defined to be in excess of 500000 messages.
  see also https://github.com/rsyslog/rsyslog/issues/3314
  closes https://github.com/rsyslog/rsyslog/issues/3334
- new global config parameter "internalmsg.severity"
  permits to specify a severity filter for internal message. Only
  messages with this severity level or more severe are logged.
  Originally this was done in rsyslog.conf as usual: you can filter
  rsyslog messages on severity, just like any other. But with systemd,
  we now emit primarily to the journal, and this is outside of rsyslog's
  rule engine and so regular filters do not apply (at least in regard
  to the journal). Logging to journal is good, because finally
  folks begin to see the messages (traditional distro configs discard
  them, for whatever is the reason).
  This commit implements a global setting for a severity-based filter
  for internal messages, before submitted to journal. So it's not 100%
  of what rsyslog can do, but at least some way to customize.
  see also https://github.com/rsyslog/rsyslog/issues/3639
- config processing bugfix: error messages if config.enabled="off" is used
  Using config.enabled="off" could lead to error messages on
  "parameter xxx not known", which were invalid. They occurred
  because the config handler expected them to be used, which
  was not the case due to being disabled.
  This commit fixes that issue.
  closes https://github.com/rsyslog/rsyslog/issues/2520
- core portability bugfix: harden shutdown processing on FreeBSD
  On FreeBSD, rsyslog does not always terminate immediately on SIGTERM.
  Root cause seems to be that SIGTERM is delivered differently under
  FreeBSD. This causes the main thread to not be awaken, and so it
  takes until the next janitor interval to come back to life - which
  can be far too long. Fixed this bug explicitly awaking the main
  thread.
- imtcp bugfix: oversize message truncation causes log to be garbled
  The actual problem is in the tcpserver component. However, the prime user
  is imtcp and so users will likely experience this as imtcp problem.
  When a too-long message is truncated, the byte after the truncation
  position becomes the first byte of the next message. This will garble
  the next messages and in almost all cases render it is syslog-noncompliant.
  The same problem does NOT occur when the message is split.
  This commit fixes the issue. It also includes a testbench fix.
  Unfortunately the test for exactly this feature was not properly
  crafted and so could not detect the problem.
  closes https://github.com/rsyslog/rsyslog/issues/3580
- omfile bugfix: FlushOnTXEnd does not work reliably with dynafiles
  The flush was only done to the last dynafile in use at end of
  transactions. Dynafiles that were also modified during the
  transaction were not flushed.
  Special thanks to Duy Nguyen for pointing us to the bug and
  suggesting a solution.
  This commit also contains a bit of cosmetic cleanup inside
  the file stream class.
  closes https://github.com/rsyslog/rsyslog/issues/2502
- lmcry_gcry build bugfix: was not always properly build
  Due to an invalid definition in build system this seems to have not
  been correctly build on at least some platforms (but it worked on
  others as it passed CI testing). This has now been corrected.
  Thanks to Remi Locherer for the patch.
- dnscache bugfix: very unlikely memory leak
  This fixes a memory leak that can only occur under OOM conditions.
  Detected by Coverity Scan, CID 203717
- testbench bugfix: wrong parameter check in diag.sh (tcpflood())
  When first parameter is check_only, the tcpflood funtion shall not
  abort the test itself (The fail is intended if this option is set).
  closes issue #3625
- testbench bugfix: imfile-symlink test failed w/ parallel test run
  The test sometimes failed. It used a symlink to a hardcoded name
  rsyslog-link.*.log. This symlink was created but then disappears.
  The reason is that upon (every!) test exit, rsyslog-link.*.log is
  deleted. So a parallel test running the exit procedure just at the
  "right" time can removed that file.
  The bug is that the file name should be created using the tests's
  dynamic name. This is done now.
  closes https://github.com/rsyslog/rsyslog/issues/3550
------------------------------------------------------------------------------
Version 8.1904.0 (aka 2019.04) 2019-04-16
- omfile: provide more helpful error message on file write errors
  now contains actual file name plus a link to probable causes for this type
  of problem
- imfile: emit error on startup if no working directory is set
  When the work directory has not been set or is invalid, state files
  are created in the root of the file system. This is neither expected
  nor desirable. We now complain loudly about this fact. For backwards
  compatibility reasons, we still need to support running imfile in
  this case.
  closes https://github.com/rsyslog/rsyslog/issues/1296
- dnscache: add global parameter dnscache.default.ttl
  This permits to control default TTL for cache entries. If set
  to 0, the DNS cache is effectively disabled.
  closes https://github.com/rsyslog/rsyslog/issues/49
  closes https://github.com/rsyslog/rsyslog/issues/1487
- omelasticsearch: new parameter rebindinterval
  Thanks to Richard Megginson for the patch.
- omelasticsearch: new parameter skipverifyhost
  Add ability to specify the libcurl CURLOPT_SSL_VERIFYHOST
  option to skip verification of the hostname in the peer cert.
  WARNING: This option is insecure, and should only be used
  for testing. The default value is off, meaning, the hostname
  will be verified by default.
  Thanks to Richard Megginson for the patch.
- omelasticsearch: set rawmsg to data from original request
  Previously, when constructing the message to submit for a retry
  for an original request, if the original request did not contain
  the field `message`, the system property `rawmsg` was set to
  the entire metadata + data from the original request.  This was
  causing problems with Elasticsearch.  This patch changes
  the code so that the `rawmsg` will be set to only the data part
  of the original request if there is no `message` field.
  closes https://github.com/rsyslog/rsyslog/issues/3573
  Thanks to Richard Megginson for the patch.
- mmkubernetes - support for metadata cache expiration
  New parameters for mmkubernetes (module and action):
  * `cacheexpireinterval`
    If `cacheexpireinterval` is -1, then do not check for cache expiration.
    If `cacheexpireinterval` is 0, then check for cache expiration.
    If `cacheexpireinterval` is greater than 0, check for cache expiration
    if the last time we checked was more than this many seconds ago.
  * `cacheentryttl` - maximum age in seconds for cache entries
  New statistics counters:
  * `podcachenumentries` - the number of entries in the pod metadata cache.
  * `namespacecachenumentries` - the number of entries in the namespace
      metadata cache.
  * `podcachehits` - the number of times a requested entry was found in the
      pod metadata cache.
  * `namespacecachehits` - the number of times a requested entry was found
      in the namespace metadata cache.
  * `podcachemisses` - the number of times a requested entry was not found
      in the pod metadata cache, and had to be requested from Kubernetes.
  * `namespacecachemisses` - the number of times a requested entry was not
      found in the namespace metadata cache, and had to be requested from
      Kubernetes.
- imdocker: new contributed module
  imdocker will get (docker) container logs from a host as well as filling
  out some basic container metadata as id, name, image, labels.
  Thanks to Nelson Yen for the contribution.
- mmtaghostname: new contributed module
  This module allows one to force hostname after parsing to the localhostname of
  rsyslog and/or add a tag to messages received from input modules without
  tag parameter.
  Thanks to Philippe Duveau for the contribution.
- imbatchreport: new contributed input module
  This input module manage batches' reports : complete file as a single log.
  Thanks to Philippe Duveau for the contribution.
- imtuxedolog: new contributed input module for Tuxedo ULOG
  Thanks to Philippe Duveau for the contribution.
- openssl network driver: Added support setting openssl configcommands
  We are using the gnutlsPriorityString setting variable, to pass
  configuration commands to openssl.
  closes: https://github.com/rsyslog/rsyslog/issues/3605
- omkafka: drop messages rejected due to being too large
  Drop messages that were rejected due to
  'RD_KAFKA_RESP_ERR_MSG_SIZE_TOO_LARGE' error
  Thanks to Nelson Yen for the patch
- core/action: implement capability to resume/suspend via external file
  It has been reported that some TCP receivers exists that accept syslog tcp
  messages at any rate, even if they do not manage to actually process them.
  Instead, they silently drop the message. This behavior is not configurable.
  All in all, it can lead to considerate message loss.
  To support such use cases, we need to provide an ability to externally
  trigger actions suspension and resumption.
  We do this via a configured file which contains the status of the action.
  Rsyslog periodically reads the file and if it contains "SUSPEND", it
  suspend the action (and likewise for resume).
  closes https://github.com/rsyslog/rsyslog/issues/2924
- improg bugfix: some memory leaks
  Thanks to Philippe Duveau for the contribution.
- msg object bugfix: regression from 1255a67
  closes https://github.com/rsyslog/rsyslog/issues/3570
- pmnormalize: fix memory leaks, improve tests
  This patch fixes a set of problems plus provides more and enhanced
  tests for the module.
  Most important problem was a memory leak that occurred when a message
  could not be passed at all. For each message that could not be parsed
  memory of at least the size the message is leaked. Depending on
  traffic pattern this can quickly lead to OOM. Note, however, that
  this leak was never reported - it was discovered as part of code
  review.
  closes https://github.com/rsyslog/rsyslog/issues/2007
- omkafka bugfix: build failure due to inconsistent type
  fails depending on platform and settings; was somehow undetected by CI
- imjournal bugfix: potential segfault on some API failure returns
  In one case there was possibility of free()'d value of journal
  cursor not being reset, causing double-free and crash later on.
  closes https://github.com/rsyslog/rsyslog/issues/3537
- openssl subsystem bugfix: better error handling
  Handling of SSL_ERROR_SYSCALL has been hardened.
  Handling for SSL_Shutdown errors has been corrected.
  Also fixed SSL Shutdown handling in tcpflood (openssl code).
  If SSL_Shutdown returns error, we call SSL_read as described in
  the documentation to do a bidirectional shutdown.
  Closes https://github.com/rsyslog/rsyslog/issues/3561
- imjournal bugfix: Fetching journal cursor only for valid journal
  The sd_journal_get_cursor() got called regardless of previous
  retcodes from other journal calls which flooded logs with journald
  errors. Now skipping the call in case of previous journal call
  non-zero result. Fixed success checking of get_cursor() call
  to eliminate double-free possibility.
  Also, making WorkAroundJournalBug true by default, as there were no
  confirmed performance regressions for a quite long time.
  Thanks to Jiri Vymazal for the patch.
- omamqp: fix build errors
  They occur on some, newer, platforms. We do not really fix them, but rather
  make the compiler ignore them. This is not really good, but the module is
  contributed and so that's for now the best thing we can do.
- testbench: change manytcp.sh to use a larger connection count again
  not sure why it was reduced, maybe related to
  https://github.com/rsyslog/rsyslog/issues/1108
  also, modernize this and another test
- tcpflood bugfix: make soft connection limit work again
  It looks like the soft limit became defunct when tcpflood was enhanced to
  request more open file handles from OS.
  closes https://github.com/rsyslog/rsyslog/issues/1108
- testbench bugfix: omhttp tests were not run during "make distcheck"
- build system bugfix: omhttp test files were not included in dist tarball
  Thanks to Thomas D. (whissi) for the patch.
------------------------------------------------------------------------------
Version 8.1903.0 (aka 2019.03) 2019-03-05
- omrabbitmq: add features (RabbitMQ HA management, templatize routing_key, 
  populate amqp message headers, delivery_mode and expiration parameters) 
- improg: create input module to use external program as input datas
- imtuxedoulog: create input module to consume Tuxedo ULOG files
- omhttp: rewritten with large feature enhancements
  Many thanks to Gabriel Intrator for this work. Gabriel also has adopted the
  module and plans to support it in the future.
- pmdb2diag: create parser module for DB2 diag logs
- TLS subsystem: add support for certless communication
  both openssl and GnuTLS drivers have been updated to support certless
  communications. In this case e.g. Diffie-Helman is used.
  NOTE: this is an insecure mode, as it does NOT guard against
  man-in-the-middle attacks. We implemented it because of the large demand,
  not because we think it makes sense to use this mode. We strongly recommend
  against it.
  closes https://github.com/rsyslog/rsyslog/issues/1068
- imrelp/omrelp: add capability to specify tlslib for librelp
  closes https://github.com/rsyslog/rsyslog/issues/3451
- build system: introduce a better way to handle compiler pragmas
  we now use macros and _Pragma(). This requires less code lines and is more
  portable.
- omkafka: add support for dynamic keys
  A new configuration property "dynaKey" is added that, when "on", changes the
  value of property "key" to a template names instead of a constant value.
  This is similar in approach to the DynaTopic implementation.
  Thanks to Ludo Brands for the patch.
- AIX port: add AIX linking extensions on many plugins and contributions to
  allow building them on this os.
- template: add Time-Related System Property $wday which is the day of week
  This allows one to get a week based rotation of log as AIX does.
- ksi subsystem: add high availability mode
  Note: ksi subsystem now REQUIRES libksi 3.19.0 or above
  Thanks to Allan Park for the patch.
  closes https://github.com/rsyslog/rsyslog/issues/3338
- imfile bugfix: file reader could get stuck
  State file handling was invalid. When a file was moved and re-created
  rsyslog could use the file_id if the new file to write the old files'
  state file. This could make the file reader stuck until it reached the
  previous offset. Depending on file sizes this could never happen AND
  would cause large message loss. This situation was timing dependent
  (a race) and most frequently occurred under log rotation. In polling
  mode the bug was less likely, but could also occur.
  closes: https://github.com/rsyslog/rsyslog/issues/3465
  closes: https://github.com/rsyslog/rsyslog/issues/3468
- imfile bugfix: potential segfault when working with directories or symlinks
  see also https://github.com/rsyslog/rsyslog/pull/3496
  Thanks to Nelson Yen for the patch
- omhttp bugfix: header items could not have spaces in them
  Thanks to Nathan Brown for the patch.
- core bugfix: enlarged msg offset types for bigger structured messages
  using a large enough (dozens of kBs) structured message
  it is possible to overflow the signed short type which leads
  to rsyslog crash. (applies to msg.c, the message object)
  Thanks to Jiri Vymazal for the patch.
- core bugfix for AIX: timeval2syslogTime now handle the bias according to
  local time zone as documented by IBM.
- imfile feature: add configuration parameter to force parsing of read logs
- imczmq bugfix:
  Release zframe following read from socket
  Make the 0MQ frame pointer local to the receive loop and destroy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     