Documentation

Write data to InfluxDB

Use Chronograf to write data to InfluxDB. Choose from the following methods:

Upload line protocol through the Chronograf UI

  1. Select Explore in the left navigation bar.

  2. Click Write Data in the top right corner of the Data Explorer.

    Write data to InfluxDB with Chronograf
  3. Select the database (if an InfluxQL data source is selected) or database and retention policy (if a Flux data source is selected) to write to.

    Select database and retention policy to write to
  4. Select one of the following methods for uploading line protocol:

    • Upload File: Upload a file containing line protocol to write to InfluxDB. Either drag and drop a file into the file uploader or click to use your operating systems file selector and choose a file to upload.
    • Manual Entry: Manually enter line protocol to write to InfluxDB.
  5. Select the timestamp precision of your line protocol. Chronograf supports the following units:

    • s (seconds)
    • ms (milliseconds)
    • u (microseconds)
    • ns (nanoseconds)
    Select write precision in Chronograf
  6. Click Write.

Use the InfluxQL INTO clause in a query

To write data back to InfluxDB with an InfluxQL query, include the INTO clause in your query:

  1. Select Explore in the left navigation bar.

  2. Select InfluxQL as your data source type.

  3. Write an InfluxQL query that includes the INTO clause. Specify the database, retention policy, and measurement to write to. For example:

    SELECT *
    INTO "mydb"."autogen"."example-measurement"
    FROM "example-db"."example-rp"."example-measurement"
    GROUP BY *
    
  4. Click Submit Query.

Use InfluxQL to write to InfluxDB 2.x or InfluxDB Cloud

To use InfluxQL to write to an InfluxDB 2.x or InfluxDB Cloud instance, configure database and retention policy mappings and ensure the current InfluxDB connection includes the appropriate connection credentials.

Use the Flux to() function in a query

To write data back to InfluxDB with an InfluxQL query, include the INTO clause in your query:

  1. Select Explore in the left navigation bar.

  2. Select Flux as your data source type.

    To query InfluxDB with Flux, enable Flux in your InfluxDB configuration.

  3. Write an Flux query that includes the to() function. Provide the database and retention policy to write to. Use the db-name/rp-name syntax:

    from(bucket: "example-db/example-rp")
      |> range(start: -30d)
      |> filter(fn: (r) => r._measurement == "example-measurement")
      |> to(bucket: "mydb/autogen")
    
  4. Click Run Script.


Was this page helpful?

Thank you for your feedback!


Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

InfluxDB Cloud backed by InfluxDB IOx

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by IOx, this is the correct documentation.

If powered by TSM, see the TSM-based InfluxDB Cloud documentation.

InfluxDB Cloud backed by InfluxDB TSM

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine which enables nearly unlimited series cardinality and SQL query support. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by TSM, this is the correct documentation.

If powered by IOx, see the IOx-based InfluxDB Cloud documentation.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.