Do InfluxDB docker image support UDP?

Trying to setup UDP listener.

Running container:

docker run -p 8086:8086 -p 8089:8089 -e INFLUXDB_UDP_ENABLED=true influxdb:1.7.3

startup logs:

ts=2019-01-31T15:16:47.655172Z lvl=info msg="InfluxDB starting" log_id=0DL7a1el000 version=1.7.3 branch=1.7 commit=698dbc789aff13c2678357a6b93ff73dd7136571
ts=2019-01-31T15:16:47.655280Z lvl=info msg="Go runtime" log_id=0DL7a1el000 version=go1.11 maxprocs=4
ts=2019-01-31T15:16:47.762732Z lvl=info msg="Using data dir" log_id=0DL7a1el000 service=store path=/var/lib/influxdb/data
ts=2019-01-31T15:16:47.762965Z lvl=info msg="Compaction settings" log_id=0DL7a1el000 service=store max_concurrent_compactions=2 throughput_bytes_per_second=50331648 throughput_bytes_per_second_burst=50331648
ts=2019-01-31T15:16:47.763174Z lvl=info msg="Open store (start)" log_id=0DL7a1el000 service=store trace_id=0DL7a24l000 op_name=tsdb_open op_event=start
ts=2019-01-31T15:16:47.763289Z lvl=info msg="Open store (end)" log_id=0DL7a1el000 service=store trace_id=0DL7a24l000 op_name=tsdb_open op_event=end op_elapsed=0.121ms
ts=2019-01-31T15:16:47.763416Z lvl=info msg="Opened service" log_id=0DL7a1el000 service=subscriber
ts=2019-01-31T15:16:47.763709Z lvl=info msg="Starting monitor service" log_id=0DL7a1el000 service=monitor
ts=2019-01-31T15:16:47.764062Z lvl=info msg="Registered diagnostics client" log_id=0DL7a1el000 service=monitor name=build
ts=2019-01-31T15:16:47.764136Z lvl=info msg="Registered diagnostics client" log_id=0DL7a1el000 service=monitor name=runtime
ts=2019-01-31T15:16:47.764292Z lvl=info msg="Registered diagnostics client" log_id=0DL7a1el000 service=monitor name=network
ts=2019-01-31T15:16:47.764419Z lvl=info msg="Registered diagnostics client" log_id=0DL7a1el000 service=monitor name=system
ts=2019-01-31T15:16:47.764732Z lvl=info msg="Starting precreation service" log_id=0DL7a1el000 service=shard-precreation check_interval=10m advance_period=30m
ts=2019-01-31T15:16:47.764852Z lvl=info msg="Storing statistics" log_id=0DL7a1el000 service=monitor db_instance=_internal db_rp=monitor interval=10s
ts=2019-01-31T15:16:47.765130Z lvl=info msg="Starting snapshot service" log_id=0DL7a1el000 service=snapshot
ts=2019-01-31T15:16:47.765304Z lvl=info msg="Starting continuous query service" log_id=0DL7a1el000 service=continuous_querier
ts=2019-01-31T15:16:47.765317Z lvl=info msg="Starting HTTP service" log_id=0DL7a1el000 service=httpd authentication=false
ts=2019-01-31T15:16:47.765321Z lvl=info msg="opened HTTP access log" log_id=0DL7a1el000 service=httpd path=stderr
ts=2019-01-31T15:16:47.765379Z lvl=info msg="Listening on HTTP" log_id=0DL7a1el000 service=httpd addr=[::]:8086 https=false
ts=2019-01-31T15:16:47.765389Z lvl=info msg="Starting retention policy enforcement service" log_id=0DL7a1el000 service=retention check_interval=30m
ts=2019-01-31T15:16:47.766490Z lvl=info msg="Started listening on UDP" log_id=0DL7a1el000 service=udp addr=:8089
ts=2019-01-31T15:16:47.766871Z lvl=info msg="Sending usage statistics to usage.influxdata.com" log_id=0DL7a1el000
ts=2019-01-31T15:16:47.767217Z lvl=info msg="Listening for signals" log_id=0DL7a1el000

Sending package to influx:

echo "cpu name=f age=1" | nc -u localhost 8089

Using postman I send request:

localhost:8086/query?q=SHOW DATABASES

It returns:
{ "results": [ { "statement_id": 0, "series": [ { "name": "databases", "columns": [ "name" ], "values": [ [ "_internal" ] ] } ] } ] }

Hi @rambo

You can set UDP with Docker by using:

docker run -p 8086:8086 -p 8089:8089/udp -e INFLUXDB_UDP_ENABLED=true influxdb:1.7.3
2 Likes

Hi @rawkode
Thank you, it works!