liveBook · Manning

Select statement

As explained in Logs and Telemetry

A SELECT statement is a query construct that projects fields or computed values from a stream or tagged event source.

A SELECT statement projects fields or computed values from a Fluent Bit stream or tagged event source. Its SQL-like expression is defined in a separate stream-processing configuration file and referenced by the main configuration. section 8.3

A basic statement combines:

  • A selected attribute or computed expression, such as rand_value. section 8.3
  • A source introduced with TAG or STREAM, such as TAG:'random-num'. section 8.3
  • Optional functions and filtering, including record_tag(), sum(), count(), now(), and WHERE. section 8.3

Project a tagged field

Define a stream task with `SELECT rand_value FROM TAG:'random-num';`, configure a random input with that tag, and run Fluent Bit. The selected records appear on stdout when stdout is enabled; the demonstrated configuration initially routes other output to null. section 8.3

Listing 8.1 Query stream processor definition: query.conf
[STREAM_TASK]      #1
  name    selectTask           #2
  exec     SELECT rand_value FROM TAG:'random-num';      #3

View the compact stream-task configuration for the tagged-field projection. section 8.3

How Logs and Telemetry covers it

How deep it goes
Explains expression structure, tagged sources, configuration separation, functions, filtering, and observed output without covering query internals.
Examples
Uses random input records, tagged rand_value fields, aggregate functions, timestamps, WHERE filtering, and Fluent Bit configuration listings.
What it assumes
Assumes basic Fluent Bit configuration and introduces query structure through a random input and tagged records.
What you can do after
Build it from scratch by defining stream tasks, selecting tagged fields, applying functions or filters, and wiring Fluent Bit configuration.
How it connects
Connects SQL-like queries with stream processing, tags, streams, input plugins, parsers, aggregation functions, and output plugins.

Also explained in

Compare how 9 books explain select statement →

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.