Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Points sent via UDP are not stored in the correct database #647

Closed
@shantanoo-desai

Description

@shantanoo-desai

Overview

  • influxdb-python : v.5.2.0
  • python: version 3.4.3
  • Machine: Window 10 + Windows subsystem for Linux (WSL)

Scenario

  • Configured udp to be accessed via 8089
  • InfluxDB running via Powershell
  • Python Script executed via WSL

Code

from influxdb import InfluxDBClient

def main():
    client = InfluxDBClient(host='localhost',database='example',use_udp=True, udp_port=8089)

    json_body = {
        "tags": {
            "host": "server01",
            "region": "us-west"
        },
        "time": "2009-11-10T23:00:00Z",
        "points": [{
            "measurement": "cpu_load_short",
            "fields": {
            "value": 0.64
            }
    }]
    }

    try:
        client.send_packet(json_body)
    except Exception as e:
        raise e


if __name__ == '__main__':
    main()

Output

Influx Shell
grafik

Instead of saving the information in the example database the information is stored in a newly created database called udp.

No measurements are created in example
grafik

All values are available in udp
grafik

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions