content/flux/v0/stdlib/kafka/to.md
kafka.to() sends data to Apache Kafka brokers.
(
<-tables: stream[A],
brokers: [string],
topic: string,
?balancer: string,
?name: string,
?nameColumn: string,
?tagColumns: [string],
?timeColumn: string,
?valueColumns: [string],
) => stream[A] where A: Record
{{% caption %}} For more information, see Function type signatures. {{% /caption %}}
({{< req >}}) List of Kafka brokers to send data to.
({{< req >}}) Kafka topic to send data to.
Kafka load balancing strategy. Default is hash.
The load balancing strategy determines how messages are routed to partitions available on a Kafka cluster. The following strategies are available:
Kafka metric name. Default is the value of the nameColumn.
Column to use as the Kafka metric name.
Default is _measurement.
Time column. Default is _time.
List of tag columns in input data.
List of value columns in input data. Default is ["_value"].
Input data. Default is piped-forward data (<-).
import "kafka"
import "sampledata"
sampledata.int()
|> kafka.to(
brokers: ["http://127.0.0.1:9092"],
topic: "example-topic",
name: "example-metric-name",
tagColumns: ["tag"],
)