bloblang

BETA: This component is experimental and therefore subject to change outside of major version releases.

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.

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

Fields

mapping

A bloblang mapping to use for generating messages.

Type: string
Default: ""

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

interval

The time interval at which messages should be generated. If set to an empty string messages will be generated as fast as downstream services can process them.

Type: string
Default: "1s"

count

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

Examples

You can use Bloblang to generate payloads of differing structure at random:

input:
bloblang:
mapping: |
root = if random_int() % 2 == 0 {
{
"type": "foo",
"foo": "is yummy"
}
} else {
{
"type": "bar",
"bar": "is gross"
}
}