:plugin: generator
:type: input
:default_codec: plain

///////////////////////////////////////////
START - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////
:version: %VERSION%
:release_date: %RELEASE_DATE%
:changelog_url: %CHANGELOG_URL%
:include_path: ../../../../logstash/docs/include
///////////////////////////////////////////
END - GENERATED VARIABLES, DO NOT EDIT!
///////////////////////////////////////////

[id="plugins-{type}s-{plugin}"]

=== Generator input plugin

include::{include_path}/plugin_header.asciidoc[]

==== Description

Generate random log events.

The general intention of this is to test performance of plugins.

An event is generated first

[id="plugins-{type}s-{plugin}-ecs"]
==== Compatibility with the Elastic Common Schema (ECS)

This plugin uses different field names depending on whether {ecs-ref}[ECS-compatibility]
in enabled (see also <<plugins-{type}s-{plugin}-ecs_compatibility>>).

|========
| ECS Disabled | ECS v1, v8 | Description

| `host`  | `[host][name]` | The name of the {ls} host that processed the event
| `sequence` | `[event][sequence]` | The sequence number for the generated event
|========

[id="plugins-{type}s-{plugin}-options"]
==== Generator Input Configuration Options

This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.

[cols="<,<,<",options="header",]
|=======================================================================
|Setting |Input type|Required
| <<plugins-{type}s-{plugin}-count>> |<<number,number>>|No
| <<plugins-{type}s-{plugin}-ecs_compatibility>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-lines>> |<<array,array>>|No
| <<plugins-{type}s-{plugin}-message>> |<<string,string>>|No
| <<plugins-{type}s-{plugin}-threads>> |<<number,number>>|No
|=======================================================================

Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
input plugins.

&nbsp;

[id="plugins-{type}s-{plugin}-count"]
===== `count` 

  * Value type is <<number,number>>
  * Default value is `0`

Set how many messages should be generated.

The default, `0`, means generate an unlimited number of events.

[id="plugins-{type}s-{plugin}-ecs_compatibility"]
===== `ecs_compatibility`

  * Value type is <<string,string>>
  * Supported values are:
    ** `disabled`: uses backwards compatible field names, such as `[host]`
    ** `v1`, `v8`: uses fields that are compatible with ECS, such as `[host][name]`

Controls this plugin's compatibility with the {ecs-ref}[Elastic Common Schema (ECS)].
See <<plugins-{type}s-{plugin}-ecs>> for detailed information.


**Sample output: ECS enabled**
[source,ruby]
-----
{
    "message" => "Hello world!",
    "event" => {
        "sequence" => 0
    },
    "host" => {
        "name" => "the-machine"
    }
}
-----

**Sample output: ECS disabled**
[source,ruby]
-----
{
    "message" => "Hello world!",
    "sequence" => 0,
    "host" => "the-machine"
}
-----

[id="plugins-{type}s-{plugin}-lines"]
===== `lines` 

  * Value type is <<array,array>>
  * There is no default value for this setting.

The lines to emit, in order. This option cannot be used with the 'message'
setting.

Example:
[source,ruby]
    input {
      generator {
        lines => [
          "line 1",
          "line 2",
          "line 3"
        ]
        # Emit all lines 3 times.
        count => 3
      }
    }

The above will emit `line 1` then `line 2` then `line 3`, then `line 1`, etc...

[id="plugins-{type}s-{plugin}-message"]
===== `message` 

  * Value type is <<string,string>>
  * Default value is `"Hello world!"`

The message string to use in the event.

If you set this to `stdin` then this plugin will read a single line from
stdin and use that as the message string for every event.

Otherwise, this value will be used verbatim as the event message.

[id="plugins-{type}s-{plugin}-threads"]
===== `threads` 

  * Value type is <<number,number>>
  * Default value is `1`





[id="plugins-{type}s-{plugin}-common-options"]
include::{include_path}/{type}.asciidoc[]

:default_codec!:
