RSyslog Documentation

imkafka: read from Apache Kafka

Module Name:imkafka
Author:Andre Lorbach <>
Available since:8.27.0


The imkafka plug-in implements an Apache Kafka consumer, permitting rsyslog to receive data from Kafka.

Configuration Parameters

Note that imkafka supports some Array-type parameters. While the parameter name can only be set once, it is possible to set multiple values with that single parameter.

For example, to select a broker, you can use

input(type="imkafka" topic="mytopic" broker="localhost:9092" consumergroup="default")

which is equivalent to

input(type="imkafka" topic="mytopic" broker=["localhost:9092"] consumergroup="default")

To specify multiple values, just use the bracket notation and create a comma-delimited list of values as shown here:

input(type="imkafka" topic="mytopic"


Parameter names are case-insensitive.

Module Parameters

Currently none.

Action Parameters


typedefaultmandatoryobsolete legacy directive

Specifies the broker(s) to use.


typedefaultmandatoryobsolete legacy directive

Specifies the topic to produce to.


typedefaultmandatoryobsolete legacy directive

Permits to specify Kafka options. Rather than offering a myriad of config settings to match the Kafka parameters, we provide this setting here as a vehicle to set any Kafka parameter. This has the big advantage that Kafka parameters that come up in new releases can immediately be used.

Note that we use librdkafka for the Kafka connection, so the parameters are actually those that librdkafka supports. As of our understanding, this is a superset of the native Kafka parameters.


typedefaultmandatoryobsolete legacy directive

With this parameter the for the consumer is set. All consumers sharing the same belong to the same group.


typedefaultmandatoryobsolete legacy directive

Specifies the ruleset to be used.


typedefaultmandatoryobsolete legacy directive

New in version 8.38.0.

If this parameter is set to on, imkafka will parse the hostname in log if it exists. The result can be retrieved from $hostname. If it’s off, for compatibility reasons, the local hostname is used, same as the previous version.

Caveats/Known Bugs

  • currently none


Example 1

In this sample a consumer for the topic static is created and will forward the messages to the omfile action.

input(type="imkafka" topic="static" broker="localhost:9092"
                     consumergroup="default" ruleset="pRuleset")

ruleset(name="pRuleset") {
     action(type="omfile" file="path/to/file")

See also

Help with configuring/using Rsyslog:

  • Mailing list - best route for general questions
  • GitHub: rsyslog source project - detailed questions, reporting issues that are believed to be bugs with Rsyslog
  • Stack Exchange (View, Ask) - experimental support from rsyslog community

See also

Contributing to Rsyslog:

Copyright 2008-2020 Rainer Gerhards (Großrinderfeld), and Others.

Scroll to top