influx transpile

The influx transpile command transpiles an InfluxQL query to Flux source code. The transpiled query assumes the bucket name is <database>/<retention policy> and includes absolute time ranges using the provided --now time.

Usage

  1. influx transpile [InfluxQL query] [flags]

The InfluxQL query must be valid and contain both a database and measurement. See the InfluxQL documentation for more information.

Flags

FlagDescription
-h—helpHelp for the transpile command
—nowRFC3339Nano timestamp to use as now() time (default is current UTC time)

Examples

  1. ## Transpile an InfluxQL query that specifies the database,
  2. ## retention policy, and measurement.
  3. influx transpile 'SELECT example-field FROM db.rp.measurement'
  4. ## Transpile InfluxQL query using default retention policy
  5. influx transpile 'SELECT example-field FROM db..measurement'

influxql flux