Skip to main content

Configuration Reference

The taosX-Agent configuration file is located at /etc/taos/agent.toml (Linux) or C:\TDengine\cfg\agent.toml (Windows) and uses the TOML format.

Basic Configuration

ParameterRequiredDefaultDescription
endpointYesgRPC service address of taosX, e.g., http://localhost:6055
tokenYesToken generated when creating the Agent in Explorer
instanceIdNoAgent instance ID. Must be unique when running multiple Agent instances on the same machine
compressionNofalseWhether to enable communication data compression between Agent and taosX
in_memory_cache_capacityNo64Maximum number of message batches that can be cached in memory. Must be greater than 0
keep_onlineNotrueWhether to keep the Agent running and attempt to reconnect when the taosX service is unavailable or the connection is lost

Client Port Range

When Agent creates a connection to taosX, the client randomly uses a port. You can limit the port range with the [client_port_range] configuration:

ParameterRequiredDefaultRangeDescription
client_port_range.minNo4915249152–65535Minimum value of the client port range
client_port_range.maxNo6553549152–65535Maximum value of the client port range

Log Configuration

Configure logging behavior with the [log] section:

ParameterRequiredDefaultDescription
log.pathNo/var/log/taos (Linux)
C:\TDengine\log (Windows)
Directory where log files are stored
log.levelNoinfoLog level. Options: error, warn, info, debug, trace
log.compressNofalseWhether to compress log files after rolling
log.rotationCountNo30Maximum number of log files to retain in the directory. Older files are deleted when exceeded
log.rotationSizeNo1GBFile size that triggers log rolling. A new file is created when exceeded
log.reservedDiskSizeNo1GBStops writing logs when remaining disk space falls below this value
log.keepDaysNo30Number of days to retain log files. Older logs are deleted
note

log_level and log_keep_days are legacy parameters and have been deprecated. Use log.level and log.keepDays instead.

Full Configuration Example

# taosX gRPC service address (required)
endpoint = "http://192.168.1.100:6055"

# Token generated when creating the Agent in Explorer (required)
token = "your-agent-token-here"

# Agent instance ID (must be unique when running multiple instances on the same machine)
# instanceId = 48

# Enable communication data compression
# compression = true

# In-memory cache batch count
# in_memory_cache_capacity = 64

# Keep the agent running and reconnect when taosX is unavailable
keep_online = true

# Client port range
[client_port_range]
# min = 49152
# max = 65535

# Log configuration
[log]
# path = "/var/log/taos"
# level = "info"
# compress = false
# rotationCount = 30
# rotationSize = "1GB"
# reservedDiskSize = "1GB"
# keepDays = 30