Write data to InfluxDB
Discover what you’ll need to write data into InfluxDB OSS (open source). Learn how to quickly start collecting data, and then explore ways to write data, best practices, and what we recommend if you’re migrating a large amount of historical data.
- What you’ll need
- Quickly start collecting data
- Load data from sources in the InfluxDB UI
- Use no-code solutions
- Use developer tools (
influxCLI and others)
- Best practices for writing data
- Next steps
What you’ll need
To write data into InfluxDB, you need the following:
- organization – See View organizations for instructions on viewing your organization ID.
- bucket – See View buckets for instructions on viewing your bucket ID.
- API token – See View tokens for instructions on viewing your API token.
- InfluxDB URL – See InfluxDB URLs.
The InfluxDB setup process creates each of these.
Line protocol data looks like this:
mem,host=host1 used_percent=23.43234543 1556892576842902000 cpu,host=host1 usage_user=3.8234,usage_system=4.23874 1556892726597397000 mem,host=host1 used_percent=21.83599203 1556892777007291000
When writing data to InfluxDB, we recommend including a timestamp with each point. If a data point does not include a timestamp when it is received by the database, InfluxDB uses the current system time (UTC) of its host machine.
The default precision for timestamps is in nanoseconds.
If the precision of the timestamps is anything other than nanoseconds (
you must specify the precision in your write request.
InfluxDB accepts the following precisions:
Quickly start collecting data
Familiarize yourself with querying, visualizing, and processing data in InfluxDB Cloud and InfluxDB OSS by collecting data right away. The following options are available:
Quick Start for InfluxDB OSS
Select Quick Start in the last step of the InfluxDB user interface’s (UI)
setup process to quickly start collecting data with InfluxDB.
Quick Start creates a data scraper that collects metrics from the InfluxDB
The scraped data provides a robust dataset of internal InfluxDB metrics that you can query, visualize, and process.
Use Quick Start to collect InfluxDB metrics
After setting up InfluxDB v2.0, the “Let’s start collecting data!” page displays options for collecting data. Click Quick Start.
InfluxDB creates and configures a new scraper.
The target URL points to the
/metrics HTTP endpoint of your local InfluxDB instance
http://localhost:8086/metrics), which outputs internal InfluxDB
metrics in the Prometheus data format.
The scraper stores the scraped metrics in the bucket created during the
initial setup process.
Quick Start is only available in the last step of the setup process.
If you missed the Quick Start option, you can manually create a scraper
that scrapes data from the
Use sample data sets to quickly populate InfluxDB with sample time series data.
With your data in InfluxDB, you’re ready to do one or more of the following:
Query and explore your data
Query data using Flux, the UI, and the
influx command line interface.
See Query data.
Process your data
Use InfluxDB tasks to process and downsample data. See Process data.
Visualize your data
Build custom dashboards to visualize your data. See Visualize data.
Monitor your data and send alerts
Monitor your data and sends alerts based on specified logic. See Monitor and alert.
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, the following resources are available:
InfluxDB Cloud and InfluxDB Enterprise customers can contact InfluxData Support.