liveBook · Manning

Stdin input plugin

As explained in Logs and Telemetry

A stdin input plugin is a Fluent Bit input component that reads event data from a process's standard input stream.

The stdin input plugin lets Fluent Bit receive event data from another process through standard input. It fits stdout-oriented applications, including twelve-factor services, and forwards captured records into Fluent Bit’s normal pipeline. section 3.3.2 section 3.9

Configure the input around three operational choices:

  • Set the input name to stdin, assign a tag such as book_stdout, and select a parser appropriate to the incoming format. section 3.3.2
  • Keep parsing simple and enable buffering when the producer may emit data faster than Fluent Bit can consume it. section 3.3.2
  • Send Fluent Bit output to a separate file or downstream node during testing so captured events do not mix with simulator output. section 3.3.2

Pipe formatted stdout into Fluent Bit

A producer can be piped directly into a Fluent Bit configuration: `./SimulatorConfig/stdout-formatted-run.sh | fluent-bit -c ./fluentbit/stdout-monitoring.conf`. With a plaintext parser configured, Fluent Bit captures the stream and can write events as JSON to a file. Input that does not match the expected format may be skipped as invalid JSON. section 3.3.2

Listing 3.3 Capturing stdout (fragment): stdout-monitoring2.conf
[SERVICE]
  flush 1
  parsers_file ./fluentbit/simple-parser.conf    #1

[INPUT]
  name stdin
  tag book_stdout
  parser plaintext      #2

Use the configuration listing to inspect the minimal stdin input definition, including the parser and tag. section 3.3.2

Direct piping is operationally fragile for long-running producers: backpressure can block the source, and systemd-controlled processes may impose stdin constraints. For sustained output, writing to a log file and using the tail plugin can be safer; log rotation may then be required. section 3.3.2

How Logs and Telemetry covers it

How deep it goes
Explains configuration, piping, parser failures, backpressure, buffering, and safer file-based alternatives.
Examples
Uses shell pipelines, Docker-based log simulation, plaintext parsing, JSON output, and invalid-input diagnostics.
What it assumes
Assumes familiarity with shell pipes and Fluent Bit configuration while demonstrating parser and input declarations.
What you can do after
Operate/configure Fluent Bit to capture process stdout and route parsed events into files or downstream processing.
How it connects
Connects stdout logging with parsers, buffering, the tail plugin, log rotation, and twelve-factor applications.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.