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
| Field | What you choose | Details |
|---|---|---|
| Parameters | Connection, Function, Function Parameters, Timeout Override | Select the connection profile, function, configure function parameters with expression support, and optionally override timeout. |
| Settings | Description, Timeout (seconds), Retry on Timeout, Retry on Fail, On Error | Node 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 Node
Grafana Loki Push Logs Node
| Function Name | Purpose | Common Use Cases |
|---|---|---|
| Push Logs | Push lines into the stream named by labels, with metadata stored per line and the lines stamped at time | Alarm 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 Node
Grafana Loki Range Query Node
| Function Name | Purpose | Common Use Cases |
|---|---|---|
| Range Query | Run the LogQL query from start to end and return at most limit lines in direction, or a metric query's series at step | The 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 Node
Grafana Loki Instant Query Node
| Function Name | Purpose | Common Use Cases |
|---|---|---|
| Instant Query | Evaluate 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:
| Node | Expression | Description |
|---|---|---|
| Push Logs | $node["Name"].result.linesPushed | How many lines Loki accepted in the push |
$node["Name"].result.timestamp | The time the first line was stamped with, UTC RFC 3339 with nanoseconds; line i is i nanoseconds later | |
| Range Query | $node["Name"].result.resultType | streams for a log query, matrix for a metric query |
$node["Name"].result.lines | The 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.lineCount | How many lines were returned | |
$node["Name"].result.limitReached | true when Loki returned exactly Max Lines, so the window may hold more | |
$node["Name"].result.series | For 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.resultType | vector (one value per series) or scalar |
$node["Name"].result.series | One 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).