def d2influx(data):
    """ transforms internal data (list of kv ) to influx data
    [
        {
            "_id": "<unique identity>",
            "_name": "<name of data source based on id>",
            "_source": "<source name>",
            "_ts": "<timestamp of the input values in rfc3339>",

            "field1": <value1 (float)>,
            ... ,
            "fieldX": <valueX (float)>
        }
    ]
    [
        {
            "measurement": "cpu_load_short",
            "tags": {
                "host": "server01",
                "region": "us-west"
            },
            "time": "2009-11-10T23:00:00Z",
            "fields": {
                "value": 0.64
            }
        }
    ]
    """
    ret = []
    for d in data:
        _id = str(d.pop('_id'))
        _name = d.pop('_name')
        _source = d.pop('_source')
        _ts = d.pop('_ts')
        for measurement, val in d.items():
            e = {'measurement': measurement, 'tags': {'source': _source,
                'id': _id, 'name': _name}, 'time': _ts, 'fields': {'value':
                val}}
            ret.append(e)
    return ret
