diff --git a/plugins/outputs/influxdb_v2/README.md b/plugins/outputs/influxdb_v2/README.md index 1605bda0c..b176fffcd 100644 --- a/plugins/outputs/influxdb_v2/README.md +++ b/plugins/outputs/influxdb_v2/README.md @@ -12,7 +12,7 @@ The InfluxDB output plugin writes metrics to the [InfluxDB v2.x] HTTP service. ## Multiple URLs can be specified for a single cluster, only ONE of the ## urls will be written to each interval. ## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"] - urls = ["http://127.0.0.1:9999"] + urls = ["http://127.0.0.1:8086"] ## Token for authentication. token = "" diff --git a/plugins/outputs/influxdb_v2/http_internal_test.go b/plugins/outputs/influxdb_v2/http_internal_test.go index e9685da12..67daff751 100644 --- a/plugins/outputs/influxdb_v2/http_internal_test.go +++ b/plugins/outputs/influxdb_v2/http_internal_test.go @@ -19,8 +19,8 @@ func TestMakeWriteURL(t *testing.T) { act string }{ { - url: genURL("http://localhost:9999"), - act: "http://localhost:9999/api/v2/write?bucket=telegraf&org=influx", + url: genURL("http://localhost:8086"), + act: "http://localhost:8086/api/v2/write?bucket=telegraf&org=influx", }, { url: genURL("unix://var/run/influxd.sock"), @@ -28,7 +28,7 @@ func TestMakeWriteURL(t *testing.T) { }, { err: true, - url: genURL("udp://localhost:9999"), + url: genURL("udp://localhost:8086"), }, } diff --git a/plugins/outputs/influxdb_v2/http_test.go b/plugins/outputs/influxdb_v2/http_test.go index 23c3ff05e..b642b00be 100644 --- a/plugins/outputs/influxdb_v2/http_test.go +++ b/plugins/outputs/influxdb_v2/http_test.go @@ -31,7 +31,7 @@ func TestNewHTTPClient(t *testing.T) { { err: true, cfg: &influxdb.HTTPConfig{ - URL: genURL("udp://localhost:9999"), + URL: genURL("udp://localhost:8086"), }, }, { diff --git a/plugins/outputs/influxdb_v2/influxdb.go b/plugins/outputs/influxdb_v2/influxdb.go index ccafbc4bd..6076297f8 100644 --- a/plugins/outputs/influxdb_v2/influxdb.go +++ b/plugins/outputs/influxdb_v2/influxdb.go @@ -17,7 +17,7 @@ import ( ) var ( - defaultURL = "http://localhost:9999" + defaultURL = "http://localhost:8086" ErrMissingURL = errors.New("missing URL") ) @@ -28,7 +28,7 @@ var sampleConfig = ` ## Multiple URLs can be specified for a single cluster, only ONE of the ## urls will be written to each interval. ## ex: urls = ["https://us-west-2-1.aws.cloud2.influxdata.com"] - urls = ["http://127.0.0.1:9999"] + urls = ["http://127.0.0.1:8086"] ## Token for authentication. token = "" diff --git a/plugins/outputs/influxdb_v2/influxdb_test.go b/plugins/outputs/influxdb_v2/influxdb_test.go index 25af4fe6a..90a382391 100644 --- a/plugins/outputs/influxdb_v2/influxdb_test.go +++ b/plugins/outputs/influxdb_v2/influxdb_test.go @@ -16,7 +16,7 @@ func TestDefaultURL(t *testing.T) { if len(output.URLs) < 1 { t.Fatal("Default URL failed to get set") } - require.Equal(t, "http://localhost:9999", output.URLs[0]) + require.Equal(t, "http://localhost:8086", output.URLs[0]) } func TestConnect(t *testing.T) { tests := []struct { @@ -26,7 +26,7 @@ func TestConnect(t *testing.T) { { out: influxdb.InfluxDB{ URLs: []string{"http://localhost:1234"}, - HTTPProxy: "http://localhost:9999", + HTTPProxy: "http://localhost:8086", HTTPHeaders: map[string]string{ "x": "y", }, @@ -36,7 +36,7 @@ func TestConnect(t *testing.T) { err: true, out: influxdb.InfluxDB{ URLs: []string{"!@#$qwert"}, - HTTPProxy: "http://localhost:9999", + HTTPProxy: "http://localhost:8086", HTTPHeaders: map[string]string{ "x": "y", }, @@ -56,7 +56,7 @@ func TestConnect(t *testing.T) { err: true, out: influxdb.InfluxDB{ URLs: []string{"!@#$%^&*()_+"}, - HTTPProxy: "http://localhost:9999", + HTTPProxy: "http://localhost:8086", HTTPHeaders: map[string]string{ "x": "y", }, @@ -66,7 +66,7 @@ func TestConnect(t *testing.T) { err: true, out: influxdb.InfluxDB{ URLs: []string{":::@#$qwert"}, - HTTPProxy: "http://localhost:9999", + HTTPProxy: "http://localhost:8086", HTTPHeaders: map[string]string{ "x": "y", },