From 40d2ff6f7dafd2ef4a4906669966bd368f90618f Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sat, 21 Oct 2023 17:38:52 +1100 Subject: [PATCH 1/2] doc: Document the `--address` commandline flag. Link to a Go bug about strange dual-stack behaviour. Fixes: #775 --- docs/Deploying.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/Deploying.md b/docs/Deploying.md index 7d49ab33a..44f239549 100644 --- a/docs/Deploying.md +++ b/docs/Deploying.md @@ -12,6 +12,8 @@ The `--help` flag will print a list of flags for configuring `mtail`. (Flags may be prefixed with either `-` or `--`) +## Quickstart + Basic flags necessary to start `mtail`: * `--logs` is a comma separated list of filenames to extract from, but can also be used multiple times, and each filename can be a [glob pattern](http://godoc.org/path/filepath#Match). Named pipes can be read from when passed as a filename to this flag. @@ -127,6 +129,18 @@ Point your collection tool at `localhost:3903/json` for JSON format metrics. Prometheus can be directed to the /metrics endpoint for Prometheus text-based format. +### Changing the listen address + +The default port is `3903`, and can be changed with the `--port` commandline flag. + +The default address is `""` on the TCP protocol, which means it will bind to all IP addresses on the system. This can be changed with the `--address` commandline flag. + +``` +mtail --address=127.0.0.1 --port=8080` +``` + +Note that the address "0.0.0.0" is treated by Go as dual-stack: https://github.com/golang/go/issues/17615 + ### Push based collection Use the `collectd_socketpath` or `graphite_host_port` flags to enable pushing to a collectd or graphite instance. From 6fab2eb0a1bfe151089d889899add136a86fd059 Mon Sep 17 00:00:00 2001 From: Jamie Wilkinson Date: Sat, 21 Oct 2023 17:48:22 +1100 Subject: [PATCH 2/2] doc: Add some links for reference about Go address behaviour. --- docs/Deploying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Deploying.md b/docs/Deploying.md index 44f239549..beeb453e6 100644 --- a/docs/Deploying.md +++ b/docs/Deploying.md @@ -139,7 +139,7 @@ The default address is `""` on the TCP protocol, which means it will bind to all mtail --address=127.0.0.1 --port=8080` ``` -Note that the address "0.0.0.0" is treated by Go as dual-stack: https://github.com/golang/go/issues/17615 +Depending on your version of Go, the address "0.0.0.0" is treated by Go as dual-stack; see https://github.com/golang/go/issues/17615 and https://pkg.go.dev/net#Listen ### Push based collection