aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-01-04 16:26:55 +0700
committerShulhan <ms@kilabit.info>2019-01-04 16:26:55 +0700
commit00dbd5f801442a572ce14128be91202afb33237d (patch)
tree2f462d7b8391b4ca85d058368105b1f36cb0cb4e
parentba7bb17a36b5611ecd2a22c1d7393343c44cc8d3 (diff)
downloadhaminer-00dbd5f801442a572ce14128be91202afb33237d.tar.xz
doc: update README and format of example configuration
-rw-r--r--README.md6
-rw-r--r--cmd/haminer/haminer.conf58
2 files changed, 41 insertions, 23 deletions
diff --git a/README.md b/README.md
index 4684f6b..b05953b 100644
--- a/README.md
+++ b/README.md
@@ -10,21 +10,21 @@ Supported forwarder,
## Requirements
* [Go](https://golang.org) for building from source code
-* [gometalinter](https://github.com/alecthomas/gometalinter) (optional)
* [git](https://git-scm.com/) for downloading source code
* [InfluxDB](https://portal.influxdata.com/downloads) for storing
HAProxy log.
* [Chronograf](https://portal.influxdata.com/downloads) for viewing
influxdb data with graph.
+
## Building
-This steps assume that you already installed `Go`, `git`, `gometalinter`, and
-`influxdb`.
+This steps assume that you already installed `Go`, `git`, and `influxdb`.
Get the source code using git,
$ git clone git@github.com:shuLhan/haminer.git
+ $ cd haminer
$ make
The binary will be installed on `$GOPATH/bin/haminer`.
diff --git a/cmd/haminer/haminer.conf b/cmd/haminer/haminer.conf
index 1c2fb9a..1d70759 100644
--- a/cmd/haminer/haminer.conf
+++ b/cmd/haminer/haminer.conf
@@ -2,12 +2,16 @@
##
## Set default listen address in UDP.
##
-## Format: ADDR [ ":" PORT ]
+## Format
+##
+## ADDR [ ":" PORT ]
+##
## Default: 127.0.0.1:5140
##
-## Examples,
-##listen=127.0.0.1:5140
-##listen=192.168.56.1:5140
+## Examples
+##
+## listen=127.0.0.1:5140
+## listen=192.168.56.1:5140
##
#listen=
@@ -16,10 +20,13 @@
## List of HAProxy backend to be accepted and forwarded to Influxdb. Each
## backend name is separated by comma.
##
-## Format: [ name ] *[ "," name ]
+## Format
+##
+## [ name ] *[ "," name ]
+##
## Default: "", no filter (all backend are accepted).
##
-## Examples,
+## Examples
##
## accept_backend=api_01,api_02
##
@@ -30,13 +37,17 @@
## Parse HTTP request header in log file generated by "capture request header
## ..." option.
##
-## Format: [ name ] *["," name]
-## The name should contains only alphabets and underscore.
+## Format
+##
+## [ name ] *["," name]
+##
+## The name should contains only alphabets and underscore.
+##
## Default: "" (empty)
##
-## Examples,
+## Examples
##
-## capture_request_header = host , referrer
+## capture_request_header = host , referrer
##
#capture_request_header=
@@ -45,10 +56,13 @@
## The endpoint for Influxdb HTTP API write, must include database name, and
## optional authentication in query parameters.
##
-## Format: http://<hostname|IP-address>:<port>/write?db=<influxdb-name>[&u=username][&p=password]
+## Format
+##
+## http://<hostname|IP-address>:<port>/write?db=<influxdb-name>[&u=username][&p=password]
+##
## Default: "", empty. If empty the log will not forwarded to Influxdb.
##
-## Examples,
+## Examples
##
## influxdb_api_write=http://127.0.0.1:8086/write?db=haminer&u=haminer&p=haminer
##
@@ -58,7 +72,10 @@
##
## Duration, in seconds, when the logs will be forwarded.
##
-## Format: DIGIT "s"
+## Format
+##
+## DIGIT "s"
+##
## Default: "15s"
##
#forward_interval = 15s
@@ -75,24 +92,25 @@
## Format
##
## TAG-NAME "=" (DQUOTE regex DQUOTE) "=>" (DQUOTE replacement DQUOTE)
+## DQUOTE = '"' ; a double-quote
##
## Examples
##
-## http_url = /uuid/\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12} => /uuid/-
-## http_url = /id/[0-9]+ => /id/-
+## http_url = /uuid/\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12} => /uuid/-
+## http_url = /id/[0-9]+ => /id/-
##
-## This will replace "/id/1000" with "/id/-" and/or
-## "/uuid/e7282bca-73b3-48fc-9793-6446ea6ebff3" into "/uuid/-"
+## This will replace "/id/1000" with "/id/-" and/or
+## "/uuid/e7282bca-73b3-48fc-9793-6446ea6ebff3" into "/uuid/-"
##
## If the order of key is wrong, you may get the unexpected output.
## For example,
##
-## http_url = /id/[0-9]+ => /id/-
-## http_url = /uuid/\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12} => /uuid/-
+## http_url = /id/[0-9]+ => /id/-
+## http_url = /uuid/\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12} => /uuid/-
##
## Given URL with UUID that contains number at beginning,
##
-## /uuid/9845a0b4-f4c3-4600-af13-45b5b0e61630
+## /uuid/9845a0b4-f4c3-4600-af13-45b5b0e61630
##
## will result in "/uuid/-a0b4-f4c3-4600-af13-45b5b0e61630", not "/uuid/-" as
## you expected.