All Products
Search
Document Center

Lindorm:Write data using the InfluxDB line protocol

Last Updated:Mar 28, 2026

If you already have applications or devices that send data in InfluxDB line protocol format, you can point them at LindormTSDB without any code changes. LindormTSDB exposes the same /api/v2/write endpoint, so existing InfluxDB-compatible collectors work out of the box.

Prerequisites

Before you begin, ensure that you have:

  • A running LindormTSDB instance

  • The LindormTSDB proxy endpoint URL and port (default: 8242)

  • (Optional) A username and password, if authentication is enabled on your instance

Write data points

Send line protocol data to the /api/v2/write endpoint using an HTTP POST request.

RequirementHow to provide it
EndpointPOST http://<endpoint>:8242/api/v2/write
DataLine protocol text in the request body
precision (optional)Query parameter. Default: ns. Valid values: ns, us, ms, s, m, h
db (optional)Query parameter. Target database name
schema_policy (optional)Query parameter. Default: WEAK. Valid values: WEAK, STRONG, NONE
Authorization (if auth is enabled)HTTP request header. See Authentication

Example

curl -X POST \
  'http://<endpoint>:8242/api/v2/write?precision=ms&db=default' \
  -d '
sensor7,device_id=F07A1260,region=north-cn temperature=12.1,humidity=45i 1619076780000000000
sensor7,device_id=F07A1260,region=north-cn temperature=13.2,humidity=47i 1619076790000000000
sensor7,device_id=F07A1260,region=north-cn temperature=10.6,humidity=46i 1619076800000000000
sensor7,device_id=F07A1260,region=north-cn temperature=18.1,humidity=44i 1619076780000000000
sensor7,device_id=F07A1260,region=north-cn temperature=19.7,humidity=44i 1619076790000000000
'

Replace <endpoint> with your LindormTSDB proxy endpoint (for example, ld-bp1489gr5t*****-proxy-tsdb.lindorm.rds.aliyuncs.com).

Line protocol format

Each line represents one data point. Separate multiple data points with a line feed (\n).

// Syntax
<table_name>[,<tag_key>=<tag_value>[,<tag_key>=<tag_value>]] <field_key>=<field_value>[,<field_key>=<field_value>] [<timestamp>]

// Example
sensor7,device_id=F07A1260,region=north-cn temperature=12.1,humidity=45i 1619076780000000000
ElementRequiredDescription
table_nameYesName of the table to write data to
Tag setNoComma-delimited key=value pairs. Use tags for dimensions you want to filter or group by
Field setYesComma-delimited key=value pairs. At least one field is required
timestampNoUnix timestamp for the data point. Defaults to the server's current time. Default unit: nanoseconds (ns)
Important

All timestamps are stored at millisecond precision, regardless of the precision parameter value. Data submitted at sub-millisecond precision loses precision during the write. To change the timestamp precision, set the precision parameter.

Supported data types

Float

The default data type. Numbers without a suffix are parsed as Float.

// Syntax
<field_key>=<value>

// Examples
temperature=12.1
ratio=1.0
count=1
large=1.e+10

Integer

64-bit integers. Add a trailing i to the field value — without the suffix, the number is parsed as Float.

// Syntax
<field_key>=<value>i

// Examples
humidity=45i
count=101i

String

Enclose string values in double quotation marks (").

// Syntax
<field_key>="<value>"

// Examples
status="healthy"
message="hello world"

Boolean

Stores true or false values.

ValueAccepted syntax
Truet, T, true, True, TRUE
Falsef, F, false, False, FALSE
// Examples
active=true
active=TRUE
active=t
enabled=false
enabled=FALSE

Timestamp

A Unix timestamp associated with the data point. If omitted, LindormTSDB uses the server's current time.

The default precision is nanoseconds (ns). Set the precision query parameter to change the unit. Valid values: ns, us, ms, s, m, h.

Important

LindormTSDB stores all timestamps at millisecond precision. Timestamps with finer precision (for example, nanoseconds) lose precision during the write.

Authentication

If authentication is enabled on your LindormTSDB instance, include a Basic authentication header in every request.

Format:

Authorization: Basic <Base64-encoded credentials>

The credentials string is <username>:<password>, Base64-encoded. For the default username root and password root:

Authorization: Basic cm9vdDpyb290

For encoding credentials in your language of choice, refer to the Base64 encoding documentation for your runtime or standard library.

Schema policy

The schema_policy parameter controls how LindormTSDB handles writes to tables that do not yet exist or that receive new columns.

ValueBehavior
WEAK (default)Time series tables are created automatically
STRONGSpecify a strong constraint policy for the schema
NONENo schema constraint is applied

For details, see Supported schema constraint policies.

Related topics