BETA: This component is mostly stable but breaking changes could still be made outside of major version releases if a fundamental problem with the component is found.

Generates messages at a given interval using a Bloblang mapping executed without a context. This allows you to generate messages for testing your pipeline configs.

Introduced in version 3.40.0.

# Config fields, showing default values
mapping: ""
interval: 1s
count: 0



A bloblang mapping to use for generating messages.

Type: string
Default: ""

# Examples
mapping: root = "hello world"
mapping: root = {"test":"message","id":uuid_v4()}


The time interval at which messages should be generated, expressed either as a duration string or as a cron expression. If set to an empty string messages will be generated as fast as downstream services can process them.

Type: string
Default: "1s"

# Examples
interval: 5s
interval: 1m
interval: 1h
interval: '@every 1s'
interval: 0,30 */2 * * * *
interval: 30 3-6,20-23 * * *


An optional number of messages to generate, if set above 0 the specified number of messages is generated and then the input will shut down.

Type: number
Default: 0


A common use case for the generate input is to trigger processors on a schedule so that the processors themselves can behave similarly to an input. The following configuration reads rows from a PostgreSQL table every 5 minutes.

interval: '@every 5m'
mapping: 'root = {}'
- sql:
driver: postgresql
data_source_name: postgres://foouser:foopass@localhost:5432/testdb?sslmode=disable
query: "select * from foo;"
result_codec: json_array