Skip to content

plugin: input: dummy: style: #1716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 31 additions & 20 deletions pipeline/inputs/dummy.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
# Dummy

The **dummy** input plugin, generates dummy events. It is useful for testing, debugging, benchmarking and getting started with Fluent Bit.
The _Dummy_ input plugin, generates dummy events. Use this plugin for testing, debugging, benchmarking and getting started with Fluent Bit.

## Configuration Parameters
## Configuration parameters

The plugin supports the following configuration parameters:

| Key | Description | Default |
| :----------------- | :---------- | :------ |
| Dummy | Dummy JSON record. | `{"message":"dummy"}` |
| Metadata | Dummy JSON metadata. | `{}` |
| Start\_time\_sec | Dummy base timestamp, in seconds. | `0` |
| Start\_time\_nsec | Dummy base timestamp, in nanoseconds. | `0` |
| Rate | Rate at which messages are generated expressed in how many times per second. | `1` |
| Interval\_sec | Set time interval, in seconds, at which every message is generated. If set, `Rate` configuration is ignored. | `0` |
| Interval\_nsec | Set time interval, in nanoseconds, at which every message is generated. If set, `Rate` configuration is ignored. | `0` |
| Samples | If set, the events number will be limited. For example, if Samples=3, the plugin generates only three events and stops. | _none_ |
| Copies | Number of messages to generate each time they are generated. | `1` |
| Flush\_on\_startup | If set to `true`, the first dummy event is generated at startup. | `false` |
| Threaded | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |

## Getting Started
| `Dummy` | Dummy JSON record. | `{"message":"dummy"}` |
| `Metadata` | Dummy JSON metadata. | `{}` |
| `Start_time_sec` | Dummy base timestamp, in seconds. | `0` |
| `Start_time_nsec` | Dummy base timestamp, in nanoseconds. | `0` |
| `Rate` | Rate at which messages are generated expressed in how many times per second. | `1` |
| `Interval_sec` | Set time interval, in seconds, at which every message is generated. If set, `Rate` configuration is ignored. | `0` |
| `Interval_nsec` | Set time interval, in nanoseconds, at which every message is generated. If set, `Rate` configuration is ignored. | `0` |
| `Samples` | If set, the events number will be limited. For example, if Samples=3, the plugin generates only three events and stops. | _none_ |
| `Copies` | Number of messages to generate each time messages generate. | `1` |
| `Flush_on_startup` | If set to `true`, the first dummy event is generated at startup. | `false` |
| `Threaded` | Indicates whether to run this input in its own [thread](../../administration/multithreading.md#inputs). | `false` |

## Get started

You can run the plugin from the command line or through the configuration file:

### Command Line
### Command line

Run the plugin from the command line using the following command:

```bash
$ fluent-bit -i dummy -o stdout
fluent-bit -i dummy -o stdout
```

which returns results like the following:

```text
Fluent Bit v2.x.x
* Copyright (C) 2015-2022 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
Expand All @@ -37,14 +44,15 @@ Fluent Bit v2.x.x
[0] dummy.0: [[1686451467.659679509, {}], {"message"=>"dummy"}]
```

### Configuration File
### Configuration file

In your main configuration file append the following _Input_ & _Output_ sections:
In your main configuration file append the following `Input` and `Output` sections:


{% tabs %}
{% tab title="fluent-bit.conf" %}
```text

```python
[INPUT]
Name dummy
Dummy {"message": "custom dummy"}
Expand All @@ -53,9 +61,11 @@ In your main configuration file append the following _Input_ & _Output_ sections
Name stdout
Match *
```

{% endtab %}

{% tab title="fluent-bit.yaml" %}

```yaml
pipeline:
inputs:
Expand All @@ -65,5 +75,6 @@ pipeline:
- name: stdout
match: '*'
```

{% endtab %}
{% endtabs %}