sample
Last updated
Last updated
The in_sample
input plugin generates sample events. It is useful for testing, debugging, benchmarking and getting started with Fluentd.
It is included in Fluentd's core.
This plugin is the renamed version of in_dummy
.
Please see the Config File article for the basic structure and syntax of the configuration file.
See also: Input Plugin Overview
See Common Parameters.
NOTE: sample plugin doesn't support specific Parse Parameters in <parse>
section.
@type
The value must be sample
.
If you use fluentd v1.11.1 or earlier, use dummy
.
tag
string
Nothing
0.14.0
The value is the tag assigned to the generated events.
size
integer
1
0.14.4
The number of events in the event stream of each emit.
rate
integer
1
0.14.0
It configures how many events to generate per second.
auto_increment_key
string
nil
0.14.0
If specified, each generated event has an auto-incremented key field.
For example, with auto_increment_key foo_key
, the first couple of events look like:
suspend
bool
false
0.14.2
This parameter is removed since v1.10.0. This feature is automatically handled in the core.
sample
string
[{"message":"sample"}]
0.14.0
The sample data to be generated. It should be either an array of JSON hashes or a single JSON hash. If it is an array of JSON hashes, the hashes in the array are cycled through in order.
If you use fluentd v1.11.1 or earlier, use dummy
.
reuse_record
bool
false
1.17.1
If specified, it reuses the previously generated sample data. This is the default behavior in v1.17.0 or older version of Fluentd.
Since v1.17.1, the default behavior was changed to copy sample data by default to avoid the impact of destructive changes by subsequent plugins.
The new default behavior (reuse_record false
) increases the load when generating large amounts of sample data. You can use this new parameter to have the same performance as before with reuse_record
.
Note that there is one exception not to reuse the sample data even though reuse_record
is specified. If auto_increment_key
was specified, reuse_record
will be ignored.
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.