1. Inline Flux
influx query runs a Flux script passed inline as a quoted argument.
influx query 'from(bucket:"metrics") |> range(start:-1h)'Typorithm · medium
Step 1 of 8 · intro card
Buckets & InfluxQL
influx query runs Flux from the CLI — inline as a quoted string or from a file with -f.
The influx query command executes Flux against your InfluxDB, either as inline text or from a saved file.
Inline, you quote the whole script: from(bucket:"metrics") |> range(start:-1h) selects a bucket and filters the last hour.
For longer or version-controlled scripts, -f query.flux runs the Flux stored in a file.
influx query runs Flux from the CLI.
Inline scripts go in single quotes.
-f runs a Flux file.
influx query 'from(bucket:"metrics") |> range(start:-1h)'
influx query -f query.fluxConnect each part of the code to the concept before you type.
influx query runs a Flux script passed inline as a quoted argument.
influx query 'from(bucket:"metrics") |> range(start:-1h)'from(bucket:"metrics") starts the Flux pipeline by selecting a bucket.
from(bucket:"metrics")|> pipes the table into range(), which filters to the last hour.
|> range(start:-1h)-f runs the Flux script stored in a file instead of inline text.
influx query -f query.fluxRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.