Documentation

influx write dryrun

This page documents an earlier version of InfluxDB. InfluxDB v2.6 is the latest stable version. View this page in the v2.6 documentation.

The influx write dryrun command prints write output to stdout instead of writing to InfluxDB. Use this command to test writing data.

Supports line protocol, annotated CSV, and extended annotated CSV. Output is always line protocol.

Usage

influx write dryrun [flags]

Flags

FlagDescriptionInput typeMaps to ?
-c--active-configCLI configuration to use for commandstring
-b--bucketBucket name (mutually exclusive with --bucket-id)stringINFLUX_BUCKET_NAME
--bucket-idBucket ID (mutually exclusive with --bucket)stringINFLUX_BUCKET_ID
--configs-pathPath to influx CLI configurations (default ~/.influxdbv2/configs)stringINFLUX_CONFIGS_PATH
--debugOutput errors to stderr
--encodingCharacter encoding of input (default UTF-8)string
--error-filePath to a file used for recording rejected row errorsstring
-f--fileFile to importstringArray
--formatInput format (lp or csv, default lp)string
--headerPrepend header line to CSV input datastring
-h--helpHelp for the dryrun command
--hostHTTP address of InfluxDB (default http://localhost:9999)stringINFLUX_HOST
--max-line-lengthMaximum number of bytes that can be read for a single line (default 16000000)integer
-o--orgOrganization name (mutually exclusive with --org-id)stringINFLUX_ORG
--org-idOrganization ID (mutually exclusive with --org)stringINFLUX_ORG_ID
-p--precisionPrecision of the timestamps (default ns)stringINFLUX_PRECISION
--rate-limitThrottle write rate (examples: 5 MB / 5 min or 1MB/s).string
--skip-verifySkip TLS certificate verificationINFLUX_SKIP_VERIFY
--skipHeaderSkip first n rows of input datainteger
--skipRowOnErrorOutput CSV errors to stderr, but continue processing
-t--tokenAPI tokenstringINFLUX_TOKEN
-u--urlURL to import data fromstringArray

Examples

Authentication credentials

The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags:

  • --host: InfluxDB host
  • -o, --org or --org-id: InfluxDB organization name or ID
  • -t, --token: InfluxDB API token

Line protocol

Dry run writing line protocol via stdin
influx write --bucket example-bucket "
m,host=host1 field1=1.2
m,host=host2 field1=2.4
m,host=host1 field2=5i
m,host=host2 field2=3i
"
Dry run writing line protocol from a file
influx write dryrun \
  --bucket example-bucket \
  --file path/to/line-protocol.txt
Dry run writing line protocol from multiple files
influx write dryrun \
  --bucket example-bucket \
  --file path/to/line-protocol-1.txt \
  --file path/to/line-protocol-2.txt
Dry run writing line protocol from a URL
influx write dryrun \
  --bucket example-bucket \
  --url https://example.com/line-protocol.txt
Dry run writing line protocol from multiple URLs
influx write dryrun \
  --bucket example-bucket \
  --url https://example.com/line-protocol-1.txt \
  --url https://example.com/line-protocol-2.txt
Dry run writing line protocol from multiple sources
influx write dryrun \
  --bucket example-bucket \
  --file path/to/line-protocol-1.txt \
  --url https://example.com/line-protocol-2.txt

CSV

Dry run writing annotated CSV data via stdin
influx write dryrun \
  --bucket example-bucket \
  --format csv \
  "#datatype measurement,tag,tag,field,field,ignored,time
m,cpu,host,time_steal,usage_user,nothing,time
cpu,cpu1,host1,0,2.7,a,1482669077000000000
cpu,cpu1,host2,0,2.2,b,1482669087000000000
"
Dry run writing annotated CSV data from a file
influx write dryrun \
  --bucket example-bucket \
  --file path/to/data.csv
Dry run writing annotated CSV data from multiple files
influx write dryrun \
  --bucket example-bucket \
  --file path/to/data-1.csv \
  --file path/to/data-2.csv
Dry run writing annotated CSV data from a URL
influx write dryrun \
  --bucket example-bucket \
  --url https://example.com/data.csv
Dry run writing annotated CSV data from multiple URLs
influx write dryrun \
  --bucket example-bucket \
  --url https://example.com/data-1.csv \
  --url https://example.com/data-2.csv
Dry run writing annotated CSV data from multiple sources
influx write dryrun \
  --bucket example-bucket \
  --file path/to/data-1.csv \
  --url https://example.com/data-2.csv
Dry run prepending CSV data with annotation headers
influx write dryrun \
  --bucket example-bucket \
  --header "#constant measurement,birds" \
  --header "#datatype dataTime:2006-01-02,long,tag" \
  --file path/to/data.csv

Was this page helpful?

Thank you for your feedback!


Set your InfluxDB URL

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.