Kafka
This module allows the Security Engine to acquire logs from a kafka topic.
Configuration exampleβ
To monitor a kafka topic:
source: kafka
topic: my-topic
brokers:
- "localhost:9092"
timeout: 5
labels:
type: mytype
To monitor a kafka topic using SSL:
source: kafka
brokers:
- "localhost:9093"
topic: "my-topic"
timeout: 5
tls:
insecure_skip_verify: true
client_cert: /path/kafkaClient.certificate.pem
client_key: /path/kafkaClient.key
ca_cert: /path/ca.crt
labels:
type: nginx
Adding a batch configuration:
source: kafka
brokers:
- "localhost:9093"
topic: "my-topic"
timeout: 5
tls:
insecure_skip_verify: true
client_cert: /path/kafkaClient.certificate.pem
client_key: /path/kafkaClient.key
ca_cert: /path/ca.crt
labels:
type: nginx
batch:
min_bytes: 1024 # 1KB
max_bytes: 1048576 # 1MB
max_wait: 5s
queue_size: 1000
commit_interval: 1s
The reader will always start from the latest offset.
Look at the configuration parameters to view all supported options.
Parametersβ
brokersβ
The name of the kafka brockers to connect to.
Required.
topicβ
The topic name you want to read logs from.
Required.
group_idβ
The consumer group id to use.
Cannot be used with partition.
It is highly recommended to set this value, or crowdsec will only read logs from the 1st partition of the topic.
partitionβ
Read messages from the given partition. Mostly useful for debugging.
Cannot be used with group_id.
timeoutβ
Maximum time to wait for new messages before returning an empty read.
Default: 5
tls.insecure_skip_verifyβ
To disable security checks on the certificate.
Defaults to false
tls.client_certβ
The client certificate path.
Optional, when you want to enable TLS with client certificate.
tls.client_keyβ
The client key path.
Optional, when you want to enable TLS with client certificate.
tls.ca_certβ
The CA certificate path.
Optional, when you want to enable TLS with client certificate.
batch.min_bytesβ
Minimum number of bytes to accumulate in the fetch buffer before returning results.
Default: 1
batch.max_bytesβ
Maximum number of bytes to fetch in one go.
Default: 1048576 (1MB)
batch.max_waitβ
Maximum time to wait before returning a fetch, even if batch.min_bytes isnβt reached.
Default: 250ms
batch.queue_sizeβ
Maximum number of messages to buffer internally before processing.
Default: 100
batch.commit_intervalβ
Time interval between automatic commits of consumer offsets.
Default: 0 (commit after every fetch)
sourceβ
Must be kafka
DSN and command-lineβ
This datasource does not support acquisition from the command line.