You can submit data either with the telnet protocol on port 4242. The port can be changed in the kairosdb.properties file.

The format of the data is

put <metric name> <time stamp> <value> <tag> <tag>... \n

Metric name must be one word and is limited to alpha numerics with “-_.”.

Time stamp can either be in milliseconds or in seconds since Jan 1, 1970 (unix epoch) - seconds are for backwards compatibility with the original opentsdb. If the value is less than 3,000,000,000 it is considered seconds. If you want to send milliseconds you may want to consider using putm.

Value can either be a long or double value.

Tag is in the form of key=value.

Be aware that the data sent must be followed by a line feed character.

Here is a simple shell script that inserts data using netcat.


# Current time in milliseconds
now=$(($(date +%s%N)/1000000))

echo "put $metric $now $value host=A" | nc -w 30 $host 4242