liveBook · Manning

Where clause

As explained in Logs and Telemetry

A WHERE clause is a query construct that retains records satisfying a predicate over event values.

A WHERE clause filters stream-query records by evaluating a predicate against event values. In a stream processor, it narrows an aggregate or selection to matching events. section 8.3

Filter positive random values

SELECT unix_timestamp(), count(rand_value) FROM TAG:'random-num' WHERE rand_value > 0; produces a timestamp and counts records whose rand_value is greater than zero. section 8.3

Run the configured stream processor with Fluent Bit after pointing the service configuration at the query file; output includes the filtered task's count result.

How Logs and Telemetry covers it

How deep it goes
Demonstrates predicate syntax and output behavior, but does not detail predicate grammar or evaluation internals.
Examples
Uses rand_value > 0 with unix_timestamp() and count(rand_value) over the random-num tag.
What it assumes
Assumes familiarity with SELECT statements, event fields, tags, and stream-task configuration.
What you can do after
Apply it in a configured stream query to count only events whose selected value exceeds zero.
How it connects
Connects filtering with SELECT statements, event values, stream processing, aggregation, and tags.

Also explained in

Compare how 7 books explain where clause →

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.