stream
Either receives output from the specified stream or forwards input data to the specified stream. Administrative privileges are required to execute this command.
Syntax
stream [forward=BOOL] [window=INT{y|mon|w|d|h|m|s}] STREAM, ...
Required Parameter
STREAM, ...
- Name of the stream. Use comma (
,
) as a separator to specify multiple log streams. You can use a wildcard (*
) in the stream name. If you use a wild card, it receives the output from all streams matching a specific string pattern in stream name at once.
Optional Parameter
forward=BOOL
- Option to receive output from or forward input to the specified stream specified by
STREAM, ...
(default:f
).t
: Forwards the input to the stream specified bySTREAM, ...
. Use this option only when you explicitly enable the streaming feature. This option cannot be used when thewindow
option is specified.f
: Receives the input from the stream specified bySTREAM, ...
.
window=INT{y|mon|w|d|h|m|s}
- Amount of time to receive data in real time from the time the query is executed. You can specify time in units of
y
(year),mon
(month),w
(week),d
(day),h
(hour),m
(minute), ands
(second). When the unit isy
, only1y
is allowed. For example,10s
refers to "the next 10 seconds" from the time the query was executed. This option cannot be used whenforward=t
.
Usage
-
Receive the outputs of
sample1
andsample2
stream queries in real time for 10 secondsstream window=10s sample1, sample2
-
Pass 100 records from the
test
table to streamsample1
andsample2
as input.table limit=100 test | stream forward=t sample1, sample2