Home

Awesome

node-influx-udp

Build Status Coverage Status

What

Write to InfluxDB using its UDP interface.

When to use this

When not to use this

Where to get this

npm install --save influx-udp

How to use this

Configure InfluxDB for UDP: http://influxdb.com/docs/v0.7/api/reading_and_writing_data.html#writing-data-through-json-+-udp


var InfluxUdp = require('influx-udp');

var influxClient = new InfluxUdp({
    port: 4444,
    host: '127.0.0.1'
});

var data = {
    visitors: [
        {
            ip: '127.0.0.1',
            username: 'harrison'
        },
        {
            ip: '192.168.0.1',
            username: 'shawn'
        }
    ]
}

influxClient.send(data);

/* Sends this, which will put two points into the "visitors" time series:
[
    {
        "name": "visitors",
        "columns": ["ip", "username"],
        "points": [
            ["127.0.0.1", "harrison"],
            ["192.168.0.1", "shawn"]
        ]
    }
]
*/