Skip to content
Library and program to parse and forward HAProxy logs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/haminer
testdata
.gitignore
CHANGELOG.adoc
LICENSE
Makefile
README.md
config.go
config_test.go
forwarder.go
go.mod
go.sum
halog.go
haminer.go
influxdb.go
tagpreprocessor.go
tagpreprocessor_test.go
udppacket.go

README.md

haminer

Library and program to parse and forward HAProxy logs.

Supported forwarder,

  • Influxdb

Requirements

  • Go for building from source code
  • git for downloading source code
  • InfluxDB for storing HAProxy log.
  • Chronograf for viewing influxdb data with graph.

Building

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.

Configuration

haminer by default will load it's config from /etc/haminer.conf, if not specified when running the program.

See `haminer.conf for an example of possible configuration and their explanation.

Installation

(1) Copy configuration from $SOURCE/cmd/haminer/haminer/conf to /etc/haminer.conf

(2) Update haminer configuration in /etc/haminer.conf

(3) Update HAProxy config to forward log to UDP port other than rsyslog, for example,

global
	...
	log                       127.0.0.1:5140 local3
	...

Then reload or restart HAProxy.

(4) Create user and database in Influxdb,

   $ influx
   > CREATE USER "haminer" WITH PASSWORD 'haminer'
   > CREATE DATABASE haminer
   > GRANT ALL ON haminer TO haminer

(5) Run the haminer program manually,

$ $GOPATH/bin/haminer

or use a systemd service.

You can’t perform that action at this time.