Skip to main content
Version: 3.2

Grafana Loki Nodes

Push alarm texts, machine events and records into Loki as log lines, and run LogQL queries whose lines and counts drive the rest of the pipeline.

Operations
Push Logs · Range Query · Instant Query
Push
One stream per call, one line or an array in one request
Query
LogQL, line limit, window and step applied by Loki

Grafana Loki stores log lines by stream: a set of labels such as {line="bc41", machine="op20"}. MaestroHub provides three nodes on a Grafana Loki connection: Push Logs writes lines into a stream, Range Query reads lines or metric series over a time window, and Instant Query evaluates a metric query at one moment.

Configuration Quick Reference​

FieldWhat you chooseDetails
ParametersConnection, Function, Function Parameters, Timeout OverrideSelect the connection profile, function, configure function parameters with expression support, and optionally override timeout.
SettingsDescription, Timeout (seconds), Retry on Timeout, Retry on Fail, On ErrorNode description, maximum execution time, retry behavior on timeout or failure, and error handling strategy. All execution settings default to pipeline-level values.
Grafana Loki Push Logs NodeGrafana Loki Push Logs Node

Grafana Loki Push Logs Node

Grafana Loki Push Logs Node​

Function NamePurposeCommon Use Cases
Push LogsPush lines into the stream named by labels, with metadata stored per line and the lines stamped at timeAlarm texts per machine, quality records with their order number, a window of events in one request

Text is one line, a JSON object one line written as JSON (LogQL's | json reads it back), and a JSON array one line per element. Labels name the stream and come from the function, so keep their values to a small set such as the line or the machine; an order number, a serial or a trace ID belongs in Metadata, which Loki stores with each line without making a new stream.

When a resend is the same line. Each line is stamped with the Time you give, or the moment the pipeline produced the write. Line i of an array is stamped i nanoseconds later, so lines keep their order and equal texts stay apart. Loki stores a line with the same labels, time and text once; structured metadata is not part of that comparison. A resend therefore carries the same time and is the same line: the first attempt, a Retry on Fail and a store-and-forward replay all carry the time the write was produced, so a push resent after a lost answer is kept once. A pipeline test run and a run redelivered after a crash are stamped anew on each attempt, so there a resend may be a second line; set Time from the event to be one line in every case. Push Logs is eligible for store-and-forward: while Loki is unreachable, pushes are buffered and delivered when it returns.

Loki answers a push as a whole. When it refuses one (a line older than it accepts, too many labels), the node fails with Loki's reason and what to change; Loki may have kept the other lines of an array, and a replay from Failed messages stores them once only with the same times.

Grafana Loki Range Query NodeGrafana Loki Range Query Node

Grafana Loki Range Query Node

Grafana Loki Range Query Node​

Function NamePurposeCommon Use Cases
Range QueryRun the LogQL query from start to end and return at most limit lines in direction, or a metric query's series at stepThe last alarm lines of a machine before a maintenance order, error counts per minute over the last hour

Start and End take now, an offset before now (-1h, -15m), an RFC 3339 timestamp or Unix epoch seconds. Max Lines (1 to 5000, 100 by default) and the window go to Loki with the query, so Loki does the work near the data and MaestroHub never fetches more than it returns. Direction backward returns the newest lines first.

Grafana Loki Instant Query NodeGrafana Loki Instant Query Node

Grafana Loki Instant Query Node

Grafana Loki Instant Query Node​

Function NamePurposeCommon Use Cases
Instant QueryEvaluate the LogQL metric query at time and return one value per series"More than five alarms in the last ten minutes?", the error rate of a line right now

Loki evaluates only metric queries at an instant (count_over_time, rate, sum by (...)). A log query here fails with Loki's own message; use Range Query to read lines.


Output​

Every Grafana Loki node delivers its data under result, and execution facts (success, functionId, durationMs, timestamp) under _metadata:

NodeExpressionDescription
Push Logs$node["Name"].result.linesPushedHow many lines Loki accepted in the push
$node["Name"].result.timestampThe time the first line was stamped with, UTC RFC 3339 with nanoseconds; line i is i nanoseconds later
Range Query$node["Name"].result.resultTypestreams for a log query, matrix for a metric query
$node["Name"].result.linesThe log lines in the query's direction, each with timestamp, line and the stream's labels (structured metadata and the labels Loki adds, such as service_name, included). Empty for a metric query. $node["Name"].result.lines[0].line reads the newest line's text
$node["Name"].result.lineCountHow many lines were returned
$node["Name"].result.limitReachedtrue when Loki returned exactly Max Lines, so the window may hold more
$node["Name"].result.seriesFor a metric query, one object per series: its labels and its points, each a timestamp and a number value (null when Loki answered NaN or an infinity). Empty for a log query
Instant Query$node["Name"].result.resultTypevector (one value per series) or scalar
$node["Name"].result.seriesOne object per series: its labels and one point. $node["Name"].result.series[0].points[0].value reads the first series' value

The call's own facts ride along under _metadata next to the four every connected node carries: _metadata.method (the operation), _metadata.connectionId and _metadata.protocol (loki).