-
Notifications
You must be signed in to change notification settings - Fork 619
[kafka_log] Update integration to input type to provide multi-signal support #18266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
adrianchen-es
merged 16 commits into
elastic:main
from
adrianchen-es:18264-ac-kafka-multi_signal
May 1, 2026
Merged
Changes from 8 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
886769a
kafka_log: use input package layout from wip/kafka-input-uncommitted
adrianchen-es 56d5885
Merge branch 'elastic:main' into 18264-ac-kafka-multi_signal
adrianchen-es 566a5cc
Update readme and modernise kafka test container
adrianchen-es 289c889
fix typo in updated container host name
adrianchen-es 703c5b1
Update to satisfy elastic-package lint
adrianchen-es 8830779
Doc tidy up
adrianchen-es 877225d
update to align with vale lint documentation
adrianchen-es b12fb9f
tidy up typo for test container setup
adrianchen-es c9d6a69
update readme
adrianchen-es 123b88d
revert vesion bump
adrianchen-es 6c19b14
Merge branch 'main' into 18264-ac-kafka-multi_signal
ishleenk17 c8c084a
Update readme per comment
adrianchen-es e19ce63
Readme title update
adrianchen-es 51b7e1a
Remediate changelog to remove 9.4.0
adrianchen-es 174d0f9
Update packages/kafka_log/_dev/build/docs/README.md
adrianchen-es 5c31441
Update readme
adrianchen-es File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,107 @@ | ||
| # Custom Kafka Log integration | ||
| # Custom Kafka Logs Integration for Elastic | ||
|
|
||
| The custom Kafka log integration is used to read from topics in a Kafka cluster. | ||
| ## Overview | ||
|
|
||
| To configure this integration, specify a list of one or more hosts in the cluster to bootstrap the connection with, a list of topics to track, and a group_id for the connection. | ||
| The Custom Kafka Logs integration is an **input** package for Elastic Agent. It runs the Filebeat **Kafka** input so agents can **consume** records from Apache Kafka topics and ship them to Elasticsearch. Use it when applications or pipelines already publish logs or events to Kafka and you want Elastic to read from those topics without an intermediate forwarder. | ||
|
adrianchen-es marked this conversation as resolved.
Outdated
|
||
|
|
||
| ### Compatibility | ||
|
|
||
| ## Compatibility | ||
| This Integration works with all Kafka versions in between 0.11 and 2.8.0. Older versions might work as well, but are not supported. | ||
| This integration is intended for Kafka clusters where brokers speak the standard Kafka protocol. It is tested and supported for Kafka broker versions roughly between **0.11** and **2.8.0**. Earlier or later brokers can work but are not guaranteed. | ||
|
|
||
| ### How it works | ||
|
|
||
| ## Ingest Pipelines | ||
| Custom ingest pipelines may be added by adding the name to the pipeline configuration option, creating custom ingest pipelines can be done either through the API or the [Ingest Node Pipeline UI](/app/management/ingest/ingest_pipelines/). | ||
| Elastic Agent connects to your cluster using the **bootstrap hosts** you configure, joins a **consumer group** (`group_id`), and subscribes to one or more **topics**. Messages are read by the agent, enriched with Kafka metadata (for example topic, partition, offset), and written to Elasticsearch using the **dataset** name you choose (default `kafka_log.generic`). Optional **SASL**, **Kerberos**, and **TLS** settings secure the connection to the brokers. Optional **parsers** and **processors** adjust the payload on the agent before ingest. | ||
|
|
||
| **ECS Field Reference** | ||
| ## What data does this integration collect? | ||
|
|
||
| Please refer to the following [document](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) for detailed information on ECS fields. | ||
| The integration collects **log events** derived from Kafka messages: | ||
|
|
||
| - **Message payload**: Typically stored in the `message` field (format depends on your producers—plain text, JSON, syslog, and so on). | ||
| - **Kafka metadata**: Fields such as `kafka.topic`, `kafka.partition`, `kafka.offset`, `kafka.key`, and `kafka.headers` where applicable. | ||
| - **Routing fields**: `data_stream.dataset`, `data_stream.type`, and `data_stream.namespace` follow your Fleet policy and dataset name. | ||
|
|
||
| The default **dataset** is `kafka_log.generic`. Changing the **Dataset name** in the policy sends data to a different backing data stream. Dataset names must follow Elasticsearch naming rules (no `-` in the dataset segment). | ||
|
|
||
| ### Supported use cases | ||
|
|
||
| - Ingest logs or telemetry already landed on Kafka by microservices or stream processors. | ||
| - Centralize topic data for search and observability in Kibana without maintaining a separate log shipper per producer. | ||
| - Apply a custom **Ingest Pipeline** in Elasticsearch when you need parsing or ECS normalization beyond agent-side parsers. | ||
|
|
||
| ## What do I need to use this integration? | ||
|
|
||
| ### Kafka prerequisites | ||
|
|
||
| - **Network reachability** from the host running Elastic Agent to each configured bootstrap broker (hostnames and ports). | ||
| - **Topic access**: ACLs or permissions that allow your consumer **group** to read the configured topics. | ||
| - **Authentication details** if the cluster uses SASL (PLAIN, SCRAM), Kerberos, or TLS client certificates—match these to your broker configuration. | ||
|
|
||
| ### Elastic prerequisites | ||
|
|
||
| - A stack version that satisfies the integration’s **Kibana** requirement (refer to the integration manifest in Kibana or this package’s `manifest.yml`). | ||
|
|
||
| ## How do I deploy this integration? | ||
|
|
||
| ### Agent-based deployment | ||
|
|
||
| Elastic Agent runs the Kafka input and forwards events to Elasticsearch. Install the agent on a host that can reach your Kafka brokers (same VPC or routed network, firewall rules allowing outbound connections to broker listeners). | ||
|
|
||
| ### Set up steps for Kafka | ||
|
|
||
| 1. Identify **bootstrap broker addresses** (for example `kafka1:9092`) and the **topic names** to consume. | ||
| 2. Choose a unique **consumer group id** (`group_id`) for this policy integration—duplicate group membership affects partition assignment when multiple agents share the same group. | ||
| 3. If the cluster uses TLS or SASL, gather certificates, credentials, or Kerberos configuration paths before editing the integration. | ||
|
|
||
| ### Set up steps in Kibana | ||
|
|
||
| 1. Go to **Management → Integrations**. | ||
| 2. Search for **Custom Kafka Logs** and open it. | ||
| 3. Click **Add Custom Kafka Logs** (or add the integration to an existing policy). | ||
| 4. Configure the main options: | ||
| - **Hosts**: Bootstrap servers for the Kafka cluster. | ||
| - **Topics**: Topics to subscribe to. | ||
| - **Group ID**: Consumer group for this input. | ||
| - **Dataset name**: Target dataset (default `kafka_log.generic`). | ||
| - **Client ID**, **Kafka protocol version**, **initial offset**, fetch/rebalance tuning: expand **Advanced options** when needed. | ||
| 5. Configure **SSL**, **SASL**, or **Kerberos** under advanced sections if your brokers require them. | ||
| 6. Optionally set **Parsers** (for example NDJSON) or **Processors**, and **Tags**. | ||
| 7. Optionally set **Ingest Pipeline** to an Elasticsearch pipeline ID for server-side processing. | ||
| 8. Save the policy and confirm the agent receives the updated configuration. | ||
|
|
||
| ### Validation | ||
|
|
||
| 1. Produce a test message to one of the configured topics (use your usual producer tooling or `kafka-console-producer`). | ||
| 2. In Kibana, open **Analytics → Discover** and select a logs-related data view (for example `logs-*`). | ||
| 3. Filter with KQL, for example: `data_stream.dataset : "kafka_log.generic"` — adjust to match your configured **Dataset name** (default `kafka_log.generic`). | ||
| 4. Confirm fields such as `message`, `kafka.topic`, `input.type` (`kafka`), and timestamps look correct. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| For help with Elastic ingest tools, refer to [Common problems](https://www.elastic.co/docs/troubleshoot/ingest/fleet/common-problems). | ||
|
|
||
| ### Common configuration issues | ||
|
|
||
| - **Connection or timeout errors**: Verify broker addresses, ports, TLS (`ssl.enabled`), and that firewalls allow outbound traffic from the agent host to every bootstrap broker. | ||
| - **Authentication failures**: Confirm SASL mechanism, username/password, or Kerberos settings align with the broker, check broker logs for `Authentication failed` or similar. | ||
| - **No documents in Discover**: Confirm the agent is healthy, the policy applied, and the **Dataset name** matches your Discover filter. Dataset names **must not** contain hyphens. | ||
| - **Duplicate or competing consumers**: Using the same `group_id` on many agents splits partitions across them by design, use distinct groups if you need full duplicate reads. | ||
| - **Offset / replay behavior**: `initial_offset` (for example `oldest` vs `newest`) affects where consumption starts for new groups. Changing `group_id` starts a new consumer group offset state. | ||
| - **Parsing issues**: If JSON or multiline payloads look wrong, review **Parsers** and consider an Elasticsearch **Ingest Pipeline** for complex structures. | ||
|
|
||
| ## Performance and scaling | ||
|
|
||
| For architectures used to scale ingest, refer to [Ingest Architectures](https://www.elastic.co/docs/manage-data/ingest/ingest-reference-architectures). | ||
|
|
||
| - **Throughput**: Kafka throughput scales with **partitions** and consumer parallelism, multiple agents with the **same** `group_id` share partitions (one consumer per partition per group). | ||
| - **Fetch settings**: Tune **fetch** sizes and **max_wait_time** in advanced options if you need higher batching or lower latency—balance broker load and agent memory. | ||
| - **Multiple integrations**: Separate policies or dataset names help isolate indices and retention for different topic groups. | ||
| - **Elasticsearch**: Size your cluster for the volume of documents and consider ingest pipelines and index lifecycle policies for hot/warm tiers. | ||
|
|
||
| ## Reference | ||
|
|
||
| Refer to the [ECS field reference](https://www.elastic.co/guide/en/ecs/current/ecs-field-reference.html) for ECS fields. | ||
|
|
||
| Additional documentation: | ||
|
|
||
| - [Filebeat Kafka input](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-kafka.html) | ||
| - [Filebeat SSL settings](https://www.elastic.co/guide/en/beats/filebeat/current/configuration-ssl.html#ssl-common-config) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| service: kafka-service | ||
| input: kafka | ||
| vars: | ||
| data_stream.dataset: kafka_log.generic | ||
| topics: | ||
| - testTopic | ||
| hosts: | ||
| - "{{Hostname}}:{{Port}}" | ||
| group_id: system_test |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
packages/kafka_log/data_stream/generic/_dev/test/system/test-kafka-config.yml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.