Documentation

Flux

InfluxDB 3

  • InfluxDB 3 Core New
  • InfluxDB 3 Enterprise New
  • InfluxDB Clustered
  • InfluxDB 3 Cloud New
  • InfluxDB Cloud Serverless
  • InfluxDB Cloud Dedicated
  • InfluxDB 3 Explorer New

InfluxDB 2

  • InfluxDB OSS v2
  • InfluxDB Cloud (TSM)
  • Flux

InfluxDB 1

  • InfluxDB OSS v1
  • InfluxDB Enterprise
  • InfluxDB Cloud 1

Telegraf

  • Telegraf
  • Telegraf Controller New
  • Telegraf Enterprise New

Other products

  • Chronograf
  • Kapacitor
  • Flux documentation
  • Get started
    • Data model
    • Syntax basics
    • Query basics
  • Work with Flux types
    • Basic types
      • Boolean
      • Bytes
      • Duration
      • Regular expression
      • String
      • Time
      • Float
      • Integer
      • UIntegers
      • Null
    • Composite types
      • Record
      • Array
      • Dictionary
      • Function
    • Dynamic types
  • Query data sources
    • InfluxDB
    • SQL databases
      • Amazon RDS
      • Athena
      • BigQuery
      • CockroachDB
      • MariaDB
      • MySQL
      • Percona
      • PostgreSQL
      • SAP HANA
      • Snowflake
      • SQL Server
      • SQLite
      • Vertica
    • CSV
    • Bigtable
    • Select data by hour
  • Write to data sources
    • InfluxDB
    • SQL databases
      • Amazon RDS
      • BigQuery
      • CockroachDB
      • MariaDB
      • MySQL
      • Percona
      • PostgreSQL
      • SAP HANA
      • Snowflake
      • SQL Server
      • SQLite
      • Vertica
  • Define functions
  • Process data
    • Assign custom states
    • Construct JSON with reduce()
  • Join data
    • Inner join
    • Left outer join
    • Right outer join
    • Full outer join
    • Join on time
    • Troubleshoot joins
  • Work with Prometheus
    • Scrape Prometheus metrics
    • Prometheus metric types
      • Counter
      • Gauge
      • Histogram
      • Summary
  • Reference

  • Release notes
  • Standard library
    • View all functions
    • universe (built-in)
      • aggregateWindow
      • bool
      • bottom
      • bytes
      • chandeMomentumOscillator
      • columns
      • contains
      • count
      • cov
      • covariance
      • cumulativeSum
      • derivative
      • die
      • difference
      • display
      • distinct
      • doubleEMA
      • drop
      • duplicate
      • duration
      • elapsed
      • exponentialMovingAverage
      • fill
      • filter
      • findColumn
      • findRecord
      • first
      • float
      • getColumn
      • getRecord
      • group
      • highestAverage
      • highestCurrent
      • highestMax
      • histogram
      • histogramQuantile
      • holtWinters
      • hourSelection
      • increase
      • int
      • integral
      • join
      • kaufmansAMA
      • kaufmansER
      • keep
      • keys
      • keyValues
      • last
      • length
      • limit
      • linearBins
      • logarithmicBins
      • lowestAverage
      • lowestCurrent
      • lowestMin
      • map
      • max
      • mean
      • median
      • min
      • mode
      • movingAverage
      • now
      • pearsonr
      • pivot
      • quantile
      • range
      • reduce
      • relativeStrengthIndex
      • rename
      • sample
      • set
      • skew
      • sort
      • spread
      • stateCount
      • stateDuration
      • stateTracking
      • stddev
      • string
      • sum
      • tableFind
      • tail
      • time
      • timedMovingAverage
      • timeShift
      • timeWeightedAvg
      • toBool
      • today
      • toFloat
      • toInt
      • top
      • toString
      • toTime
      • toUInt
      • tripleEMA
      • tripleExponentialDerivative
      • truncateTimeColumn
      • uint
      • union
      • unique
      • window
      • yield
    • array
      • array.concat
      • array.filter
      • array.from
      • array.map
    • bitwise
      • bitwise.sand
      • bitwise.sclear
      • bitwise.slshift
      • bitwise.snot
      • bitwise.sor
      • bitwise.srshift
      • bitwise.sxor
      • bitwise.uand
      • bitwise.uclear
      • bitwise.ulshift
      • bitwise.unot
      • bitwise.uor
      • bitwise.urshift
      • bitwise.uxor
    • contrib
      • anaisdg
        • anomalydetection
          • anomalydetection.mad
        • statsmodels
          • statsmodels.linearRegression
      • bonitoo-io
        • alerta
          • alerta.alert
          • alerta.endpoint
        • hex
          • hex.bytes
          • hex.int
          • hex.string
          • hex.uint
        • servicenow
          • servicenow.endpoint
          • servicenow.event
        • tickscript
          • tickscript.alert
          • tickscript.compute
          • tickscript.deadman
          • tickscript.defineCheck
          • tickscript.groupBy
          • tickscript.join
          • tickscript.select
          • tickscript.selectWindow
        • victorops
          • victorops.alert
          • victorops.endpoint
        • zenoss
          • zenoss.endpoint
          • zenoss.event
      • chobbs
        • discord
          • discord.endpoint
          • discord.send
      • jsternberg
        • influxdb
          • from
          • influxdb.select
      • qxip
        • clickhouse
          • clickhouse.query
        • hash
          • hash.b64
          • hash.cityhash64
          • hash.hmac
          • hash.md5
          • hash.sha1
          • hash.sha256
          • hash.xxhash64
        • logql
          • logql.query_range
      • rhajek
        • bigpanda
          • bigpanda.endpoint
          • bigpanda.sendAlert
          • bigpanda.statusFromLevel
      • RohanSreerama5
        • naiveBayesClassifier
          • naiveBayesClassifier.naiveBayes
      • sranka
        • opsgenie
          • opsgenie.endpoint
          • opsgenie.respondersToJSON
          • opsgenie.sendAlert
        • sensu
          • sensu.endpoint
          • sensu.event
          • sensu.toSensuName
        • teams
          • teams.endpoint
          • teams.message
        • telegram
          • telegram.endpoint
          • telegram.message
        • webexteams
          • webexteams.endpoint
          • webexteams.message
      • tomhollingworth
        • events
          • events.duration
    • csv
      • csv.from
    • date
      • boundaries
        • boundaries.friday
        • boundaries.monday
        • boundaries.month
        • boundaries.saturday
        • boundaries.sunday
        • boundaries.thursday
        • boundaries.tuesday
        • boundaries.wednesday
        • boundaries.week
        • boundaries.yesterday
      • date.add
      • date.hour
      • date.microsecond
      • date.millisecond
      • date.minute
      • date.month
      • date.monthDay
      • date.nanosecond
      • date.quarter
      • date.scale
      • date.second
      • date.sub
      • date.time
      • date.truncate
      • date.week
      • date.weekDay
      • date.year
      • date.yearDay
    • dict
      • dict.fromList
      • dict.get
      • dict.insert
      • dict.remove
    • experimental
      • aggregate
        • aggregate.rate
      • array
        • array.concat
        • array.filter
        • array.from
        • array.map
        • array.toBool
        • array.toDuration
        • array.toFloat
        • array.toInt
        • array.toString
        • array.toTime
        • array.toUInt
      • bigtable
        • bigtable.from
      • bitwise
        • bitwise.sand
        • bitwise.sclear
        • bitwise.slshift
        • bitwise.snot
        • bitwise.sor
        • bitwise.srshift
        • bitwise.sxor
        • bitwise.uand
        • bitwise.uclear
        • bitwise.ulshift
        • bitwise.unot
        • bitwise.uor
        • bitwise.urshift
        • bitwise.uxor
      • csv
        • csv.from
      • date
        • boundaries
          • boundaries.friday
          • boundaries.monday
          • boundaries.month
          • boundaries.saturday
          • boundaries.sunday
          • boundaries.thursday
          • boundaries.tuesday
          • boundaries.wednesday
          • boundaries.week
          • boundaries.yesterday
      • dynamic
        • dynamic.asArray
        • dynamic.dynamic
        • dynamic.isType
        • dynamic.jsonEncode
        • dynamic.jsonParse
      • geo
        • geo.asTracks
        • geo.filterRows
        • geo.getGrid
        • geo.getLevel
        • geo.gridFilter
        • geo.groupByArea
        • geo.s2CellIDToken
        • geo.s2CellLatLon
        • geo.shapeData
        • geo.ST_Contains
        • geo.ST_Distance
        • geo.ST_DWithin
        • geo.ST_Intersects
        • geo.ST_Length
        • geo.ST_LineString
        • geo.stContains
        • geo.stDistance
        • geo.stLength
        • geo.strictFilter
        • geo.toRows
        • geo.totalDistance
      • http
        • requests
          • requests.do
          • requests.get
          • requests.peek
          • requests.post
        • http.get
      • influxdb
        • influxdb.api
      • iox
        • iox.from
        • iox.sql
        • iox.sqlInterval
      • json
        • json.parse
      • mqtt
        • mqtt.publish
        • mqtt.to
      • oee
        • oee.APQ
        • oee.computeAPQ
      • polyline
        • polyline.rdp
      • prometheus
        • prometheus.histogramQuantile
        • prometheus.scrape
      • query
        • query.filterFields
        • query.filterMeasurement
        • query.fromRange
        • query.inBucket
      • record
        • record.get
      • table
        • table.fill
      • usage
        • usage.from
        • usage.limits
      • experimental.addDuration
      • experimental.alignTime
      • experimental.catch
      • experimental.chain
      • experimental.count
      • experimental.diff
      • experimental.distinct
      • experimental.fill
      • experimental.first
      • experimental.group
      • experimental.histogram
      • experimental.histogramQuantile
      • experimental.integral
      • experimental.join
      • experimental.kaufmansAMA
      • experimental.last
      • experimental.max
      • experimental.mean
      • experimental.min
      • experimental.mode
      • experimental.objectKeys
      • experimental.preview
      • experimental.quantile
      • experimental.set
      • experimental.skew
      • experimental.spread
      • experimental.stddev
      • experimental.subDuration
      • experimental.sum
      • experimental.to
      • experimental.unique
      • experimental.unpivot
      • experimental.window
    • generate
      • generate.from
    • http
      • requests
        • requests.do
        • requests.get
        • requests.peek
        • requests.post
      • http.basicAuth
      • http.endpoint
      • http.pathEscape
      • http.post
    • influxdata
      • influxdb
        • monitor
          • monitor.check
          • monitor.deadman
          • monitor.from
          • monitor.log
          • monitor.logs
          • monitor.notify
          • monitor.stateChanges
          • monitor.stateChangesOnly
          • monitor.write
        • sample
          • sample.alignToNow
          • sample.data
          • sample.list
        • schema
          • schema.fieldKeys
          • schema.fieldsAsCols
          • schema.measurementFieldKeys
          • schema.measurements
          • schema.measurementTagKeys
          • schema.measurementTagValues
          • schema.tagKeys
          • schema.tagValues
        • secrets
          • secrets.get
        • tasks
          • tasks.lastSuccess
        • v1
          • v1.databases
          • v1.fieldKeys
          • v1.fieldsAsCols
          • v1.json
          • v1.measurementFieldKeys
          • v1.measurements
          • v1.measurementTagKeys
          • v1.measurementTagValues
          • v1.tagKeys
          • v1.tagValues
        • buckets
        • from
        • influxdb.cardinality
        • influxdb.wideTo
        • to
    • internal
      • boolean
      • debug
        • debug.feature
        • debug.getOption
        • debug.null
        • debug.opaque
        • debug.pass
        • debug.sink
        • debug.slurp
      • gen
        • gen.tables
      • influxql
      • location
      • promql
        • promql.changes
        • promql.emptyTable
        • promql.extrapolatedRate
        • promql.holtWinters
        • promql.instantRate
        • promql.join
        • promql.labelReplace
        • promql.linearRegression
        • promql.promHistogramQuantile
        • promql.promqlDayOfMonth
        • promql.promqlDayOfWeek
        • promql.promqlDaysInMonth
        • promql.promqlHour
        • promql.promqlMinute
        • promql.promqlMonth
        • promql.promqlYear
        • promql.quantile
        • promql.resets
        • promql.timestamp
      • testing
        • testing.assertMatches
        • testing.shouldErrorWithCode
      • testutil
        • testutil.fail
        • testutil.makeAny
        • testutil.makeRecord
        • testutil.yield
    • interpolate
      • interpolate.linear
    • join
      • join.full
      • join.inner
      • join.left
      • join.right
      • join.tables
      • join.time
    • json
      • json.encode
    • kafka
      • kafka.to
    • math
      • math.abs
      • math.acos
      • math.acosh
      • math.asin
      • math.asinh
      • math.atan
      • math.atan2
      • math.atanh
      • math.cbrt
      • math.ceil
      • math.copysign
      • math.cos
      • math.cosh
      • math.dim
      • math.erf
      • math.erfc
      • math.erfcinv
      • math.erfinv
      • math.exp
      • math.exp2
      • math.expm1
      • math.float64bits
      • math.float64frombits
      • math.floor
      • math.frexp
      • math.gamma
      • math.hypot
      • math.ilogb
      • math.isInf
      • math.isNaN
      • math.j0
      • math.j1
      • math.jn
      • math.ldexp
      • math.lgamma
      • math.log
      • math.log10
      • math.log1p
      • math.log2
      • math.logb
      • math.mInf
      • math.mMax
      • math.mMin
      • math.mod
      • math.modf
      • math.NaN
      • math.nextafter
      • math.pow
      • math.pow10
      • math.remainder
      • math.round
      • math.roundtoeven
      • math.signbit
      • math.sin
      • math.sincos
      • math.sinh
      • math.sqrt
      • math.tan
      • math.tanh
      • math.trunc
      • math.y0
      • math.y1
      • math.yn
    • pagerduty
      • pagerduty.actionFromLevel
      • pagerduty.actionFromSeverity
      • pagerduty.dedupKey
      • pagerduty.endpoint
      • pagerduty.sendEvent
      • pagerduty.severityFromLevel
    • planner
    • profiler
    • pushbullet
      • pushbullet.endpoint
      • pushbullet.pushData
      • pushbullet.pushNote
    • regexp
      • regexp.compile
      • regexp.findString
      • regexp.findStringIndex
      • regexp.getString
      • regexp.matchRegexpString
      • regexp.quoteMeta
      • regexp.replaceAllString
      • regexp.splitRegexp
    • runtime
      • runtime.version
    • sampledata
      • sampledata.bool
      • sampledata.float
      • sampledata.int
      • sampledata.numericBool
      • sampledata.string
      • sampledata.uint
    • slack
      • slack.endpoint
      • slack.message
      • slack.validateColorString
    • socket
      • socket.from
    • sql
      • sql.from
      • sql.to
    • strings
      • strings.compare
      • strings.containsAny
      • strings.containsStr
      • strings.countStr
      • strings.equalFold
      • strings.hasPrefix
      • strings.hasSuffix
      • strings.index
      • strings.indexAny
      • strings.isDigit
      • strings.isLetter
      • strings.isLower
      • strings.isUpper
      • strings.joinStr
      • strings.lastIndex
      • strings.lastIndexAny
      • strings.repeat
      • strings.replace
      • strings.replaceAll
      • strings.split
      • strings.splitAfter
      • strings.splitAfterN
      • strings.splitN
      • strings.strlen
      • strings.substring
      • strings.title
      • strings.toLower
      • strings.toTitle
      • strings.toUpper
      • strings.trim
      • strings.trimLeft
      • strings.trimPrefix
      • strings.trimRight
      • strings.trimSpace
      • strings.trimSuffix
    • system
      • system.time
    • testing
      • expect
        • expect.planner
      • testing.assertEmpty
      • testing.assertEquals
      • testing.assertEqualValues
      • testing.diff
      • testing.load
      • testing.shouldError
    • timezone
      • timezone.fixed
      • timezone.location
    • types
      • types.isNumeric
      • types.isType
  • Flux specification
    • Notation
    • Representation
    • Lexical elements
    • Variables
    • Options
    • Types
    • Blocks
    • Assignment and scope
    • Expressions
    • Operators
    • Packages
    • Attributes
    • Statements
    • Side effects
    • System built-ins
    • Data model
  • Function types & categories
  • Type signatures
  • Flux versions in InfluxDB
  • Future of Flux
  • Documentation MCP server

Related to "Sql"

iox.sqlInterval() function

iox.sqlInterval() converts a duration value to a SQL interval string.

© 2026 InfluxData, Inc.

Where are you running InfluxDB?

Select your InfluxDB Cloud region and cluster or your InfluxDB OSS URL and we’ll customize code examples for you. Identify your InfluxDB Cloud cluster.

  • InfluxDB Cloud
  • InfluxDB OSS or Enterprise
AWS
  • US West (Oregon)

GCP
Azure
Default
Custom

For more information, see InfluxDB Cloud regions or InfluxDB OSS URLs.

Thank you for your feedback!

Let us know what we can do better:

Thank you!

No thanks

InfluxDB OSS 2.9.0: API tokens are hashed by default

Stronger token security in InfluxDB OSS 2.9.0 — tokens are hashed on disk by default. Existing tokens are hashed on first startup and can’t be recovered afterward. Capture any plaintext tokens you still need before you upgrade.

View InfluxDB OSS 2.9.0 release notes

Hashed tokens authenticate exactly like unhashed tokens — clients and integrations keep working.

Also new in 2.9.0:

  • Configurable backup compression
  • Restore support for backups containing hashed tokens
  • Tighter Edge Data Replication queue validation
  • Flux upgrade
  • Compaction reliability improvements

Key enhancements in Explorer 1.9

Explorer 1.9 is now available with InfluxQL support, an AI-assisted Flux to SQL converter (beta), and new live sample data simulators.

View Explorer 1.9 release notes

Explorer 1.9 includes new features and improvements that make it easier to query, visualize, and manage data.

Highlights:

  • Flux to SQL converter (beta): Convert Flux queries to SQL with an AI-assisted converter.
  • InfluxQL support: Query data with InfluxQL in the Data Explorer and dashboards, and save and load InfluxQL queries.
  • InfluxQL visualizations: Render line and bar charts from InfluxQL results with per-tag series grouping.
  • Query error history: Review a history of query errors in the query tool.
  • Live sample data simulators: Generate continuous live sample data with new bird data and signal generator simulators.

For more details, see Explorer 1.9 release notes

InfluxDB 3.10 is now available

InfluxDB 3 Core 3.10 adds an automatic catalog format upgrade, a configurable query-concurrency limit, and processing engine improvements.

Key updates in InfluxDB 3 Core 3.10:

  • Catalog format upgrade: the on-disk catalog automatically upgrades from format v2 to v3 on first 3.10 startup. Migration is one-way—back up your catalog before upgrading.
  • --max-concurrent-queries: limit concurrent queries (adjustable at runtime).
  • GET /ready endpoint for readiness probes.
  • Processing engine: cross-database queries and trigger lockdown flags.

For more information, see the InfluxDB 3 Core release notes.

InfluxDB 3.10 is now available

InfluxDB 3 Enterprise 3.10 adds automated backup and restore, row-level deletions, and user management, with an automatic catalog format upgrade and performance preview improvements.

Key updates in InfluxDB 3 Enterprise 3.10:

  • Catalog format upgrade: the on-disk catalog automatically upgrades from format v2 to v3 on first 3.10 startup. Migration is one-way—back up your catalog before upgrading.
  • Automated backup and restore (beta)
  • Row-level deletions
  • User management (authentication and RBAC) — preview
  • Performance preview improvements

Backup and restore, row-level deletions, and the performance preview require the Enterprise storage engine upgrade (opt-in beta). Beta and preview features are subject to breaking changes and aren’t recommended for production use.

For more information, see the InfluxDB 3 Enterprise release notes

Telegraf Enterprise is now generally available

Telegraf Enterprise is now generally available, along with Telegraf Controller v1.0.

Telegraf Enterprise combines Telegraf Controller, a centralized management console for Telegraf, with official support from InfluxData. Manage configurations, monitor fleet health, and operate tens of thousands of Telegraf agents from a single system.

  • Read the announcement
  • Documentation
  • Download and install Telegraf Controller

InfluxDB Docker latest tag changing to InfluxDB 3 Core

On September 15, 2026, the latest tag for InfluxDB Docker images will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments.

If using Docker to install and run InfluxDB, the latest tag will point to InfluxDB 3 Core. To avoid unexpected upgrades, use specific version tags in your Docker deployments. For example, if using Docker to run InfluxDB v2, replace the latest version tag with a specific version tag in your Docker pull command–for example:

docker pull influxdb:2
Ask AI