write_line_protocol
Writes data to InfluxDB using line protocol format. Supports single records or batched writes with configurable timestamp precision.
Instructions
Write data to InfluxDB using line protocol format (all versions). Supports single records or batches.
Line Protocol Syntax: measurement,tag1=value1,tag2=value2 field1=value1,field2=value2 timestamp
Components:
measurement: table/measurement name (required)
tags: indexed metadata (optional) - comma-separated key=value pairs
fields: actual data (required) - space-separated from tags, comma-separated key=value pairs
timestamp: optional timestamp (precision must be specified in tool parameters)
Field Value Types:
Strings: "quoted string"
Floats: 123.45
Integers: 123i (note the 'i' suffix)
Booleans: t or f
Examples: Single record: temperature,location=office,building=main value=23.5,humidity=45i 1640995200 Batch (separate with newlines): temperature,location=office value=23.5 1640995200 humidity,location=office value=45i 1640995201
Important: Always specify correct precision parameter to match your timestamp format. Use any precision if writing data with no timestamp. Escaping required for special characters in tags/fields.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Line protocol formatted data. For multiple records, separate each line with \n | |
| noSync | No | Acknowledge without waiting for WAL persistence | |
| database | Yes | Name of the database/bucket to write to | |
| precision | Yes | Precision of timestamps | |
| acceptPartial | No | Accept partial writes |