From 4db3629bdc241825a6559552bc88af3f5c89b63e Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 25 Aug 2022 19:43:37 +0700 Subject: all: group all documents into directory _doc --- CHANGELOG.adoc | 23 ------- README | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++- README.adoc | 186 --------------------------------------------------- _doc/CHANGELOG.adoc | 23 +++++++ _doc/README.adoc | 1 + _doc/index.adoc | 25 +++++++ 6 files changed, 235 insertions(+), 210 deletions(-) delete mode 100644 CHANGELOG.adoc mode change 120000 => 100644 README delete mode 100644 README.adoc create mode 100644 _doc/CHANGELOG.adoc create mode 120000 _doc/README.adoc create mode 100644 _doc/index.adoc diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc deleted file mode 100644 index 4325949..0000000 --- a/CHANGELOG.adoc +++ /dev/null @@ -1,23 +0,0 @@ -// SPDX-FileCopyrightText: 2018 M. Shulhan -// SPDX-License-Identifier: GPL-3.0-or-later -= CHANGELOG -:toc: -:sectanchors: -:sectlinks: - -[#v0.2.0] -== haminer v0.2.0 (2022-08-20) - -This release relicensing the software to GPLv3, add support for forwarding -logs to InfluxDB v2 and questdb [1]. - -[1] https://questdb.io. - - -[#v0.1.0] -== haminer v0.1.0 - -=== Features - -* Forwarding logs to InfluxDB -* Preprocessing http URL for grouping in InfluxDB diff --git a/README b/README deleted file mode 120000 index bff755a..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.adoc \ No newline at end of file diff --git a/README b/README new file mode 100644 index 0000000..060e9f0 --- /dev/null +++ b/README @@ -0,0 +1,186 @@ +// SPDX-FileCopyrightText: 2018 M. Shulhan +// SPDX-License-Identifier: GPL-3.0-or-later += haminer +:toc: +:sectanchors: +:sectlinks: + +Library and program to parse and forward HAProxy logs. + +Supported forwarder: Influxdb, QuestDB. + + +== Installation + +=== Building from source + +*Requirements* + +* https://golang.org[Go^] for building from source code +* https://git-scm.com/[git^] for downloading source code + +Get the source code using git, + +---- +$ git clone https://git.sr.ht/~shulhan/haminer +$ cd haminer +$ make +---- + +The binary name is `haminer` build in the current directory. + + +=== Pre-build package + +The Arch Linux package is available at build.kilabit.info. +Add the following repository to your pacman.conf, + +---- +[build.kilabit.info] +Server = https://build.kilabit.info/aur +---- + +To install it, + + $ sudo pacman -Sy --noconfirm haminer-git + + +== Configuration + +haminer by default will load it's config from `/etc/haminer.conf`, if not +specified when running the program. + +See +https://git.sr.ht/~shulhan/haminer/tree/main/item/cmd/haminer/haminer.conf[haminer.conf^] +for an example of possible configuration and their explanation. + + +=== Forwarders + +Currently, there are two supported database where haminer can forward the +parsed log: influxdb and questdb. +Haminer support Influxdb v1 and v2. + +==== Influxdb v1 + +For v1, you need to create the user and database first, + +---- +$ influx +> CREATE USER "haminer" WITH PASSWORD 'haminer' +> CREATE DATABASE haminer +> GRANT ALL ON haminer TO haminer +---- + +Example of forwarder configuration, + +---- +[forwarder "influxd"] +version = v1 +url = http://127.0.0.1:8086 +bucket = haminer +user = haminer +password = haminer +---- + +==== Influxdb v2 + +For v2, + +---- +$ sudo influx bucket create \ + --name haminer \ + --retention 30d +---- + +For v2, the example configuration is + +---- +[forwarder "influxd"] +version = v1 +url = http://127.0.0.1:8086 +org = $org +bucket = haminer +token = $token +---- + +==== Questdb + +For questdb the configuration is quite simple, + +---- +[forwarder "questdb"] +url = udp://127.0.0.1:9009 +---- + +We did not need to create the table, questdb will handled that automatically. + + +== Deployment + +. Copy configuration from `$SOURCE/cmd/haminer/haminer/conf` to +`/etc/haminer.conf` + +. Update haminer configuration in `/etc/haminer.conf` ++ +-- +For example, +---- +[haminer] +listen = 127.0.0.1:5140 + +... +---- + +Add one or more provider to the configuration as the example above. +-- + +. 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. +-- + +. Run the haminer program, ++ +-- +---- +$ haminer +---- +or use a +https://git.sr.ht/~shulhan/haminer/tree/main/item/cmd/haminer/haminer.service[systemd +service^]. + +---- +$ sudo systemctl enable haminer +$ sudo systemctl start haminer +---- +-- + + +== License + +---- +haminer - Library and program to parse and forward HAProxy logs. +Copyright (C) 2018-2022 M. Shulhan + +This program is free software: you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 of the License, or any later version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program. +If not, see . +---- diff --git a/README.adoc b/README.adoc deleted file mode 100644 index 060e9f0..0000000 --- a/README.adoc +++ /dev/null @@ -1,186 +0,0 @@ -// SPDX-FileCopyrightText: 2018 M. Shulhan -// SPDX-License-Identifier: GPL-3.0-or-later -= haminer -:toc: -:sectanchors: -:sectlinks: - -Library and program to parse and forward HAProxy logs. - -Supported forwarder: Influxdb, QuestDB. - - -== Installation - -=== Building from source - -*Requirements* - -* https://golang.org[Go^] for building from source code -* https://git-scm.com/[git^] for downloading source code - -Get the source code using git, - ----- -$ git clone https://git.sr.ht/~shulhan/haminer -$ cd haminer -$ make ----- - -The binary name is `haminer` build in the current directory. - - -=== Pre-build package - -The Arch Linux package is available at build.kilabit.info. -Add the following repository to your pacman.conf, - ----- -[build.kilabit.info] -Server = https://build.kilabit.info/aur ----- - -To install it, - - $ sudo pacman -Sy --noconfirm haminer-git - - -== Configuration - -haminer by default will load it's config from `/etc/haminer.conf`, if not -specified when running the program. - -See -https://git.sr.ht/~shulhan/haminer/tree/main/item/cmd/haminer/haminer.conf[haminer.conf^] -for an example of possible configuration and their explanation. - - -=== Forwarders - -Currently, there are two supported database where haminer can forward the -parsed log: influxdb and questdb. -Haminer support Influxdb v1 and v2. - -==== Influxdb v1 - -For v1, you need to create the user and database first, - ----- -$ influx -> CREATE USER "haminer" WITH PASSWORD 'haminer' -> CREATE DATABASE haminer -> GRANT ALL ON haminer TO haminer ----- - -Example of forwarder configuration, - ----- -[forwarder "influxd"] -version = v1 -url = http://127.0.0.1:8086 -bucket = haminer -user = haminer -password = haminer ----- - -==== Influxdb v2 - -For v2, - ----- -$ sudo influx bucket create \ - --name haminer \ - --retention 30d ----- - -For v2, the example configuration is - ----- -[forwarder "influxd"] -version = v1 -url = http://127.0.0.1:8086 -org = $org -bucket = haminer -token = $token ----- - -==== Questdb - -For questdb the configuration is quite simple, - ----- -[forwarder "questdb"] -url = udp://127.0.0.1:9009 ----- - -We did not need to create the table, questdb will handled that automatically. - - -== Deployment - -. Copy configuration from `$SOURCE/cmd/haminer/haminer/conf` to -`/etc/haminer.conf` - -. Update haminer configuration in `/etc/haminer.conf` -+ --- -For example, ----- -[haminer] -listen = 127.0.0.1:5140 - -... ----- - -Add one or more provider to the configuration as the example above. --- - -. 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. --- - -. Run the haminer program, -+ --- ----- -$ haminer ----- -or use a -https://git.sr.ht/~shulhan/haminer/tree/main/item/cmd/haminer/haminer.service[systemd -service^]. - ----- -$ sudo systemctl enable haminer -$ sudo systemctl start haminer ----- --- - - -== License - ----- -haminer - Library and program to parse and forward HAProxy logs. -Copyright (C) 2018-2022 M. Shulhan - -This program is free software: you can redistribute it and/or modify it under -the terms of the GNU General Public License as published by the Free Software -Foundation, either version 3 of the License, or any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program. -If not, see . ----- diff --git a/_doc/CHANGELOG.adoc b/_doc/CHANGELOG.adoc new file mode 100644 index 0000000..4325949 --- /dev/null +++ b/_doc/CHANGELOG.adoc @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2018 M. Shulhan +// SPDX-License-Identifier: GPL-3.0-or-later += CHANGELOG +:toc: +:sectanchors: +:sectlinks: + +[#v0.2.0] +== haminer v0.2.0 (2022-08-20) + +This release relicensing the software to GPLv3, add support for forwarding +logs to InfluxDB v2 and questdb [1]. + +[1] https://questdb.io. + + +[#v0.1.0] +== haminer v0.1.0 + +=== Features + +* Forwarding logs to InfluxDB +* Preprocessing http URL for grouping in InfluxDB diff --git a/_doc/README.adoc b/_doc/README.adoc new file mode 120000 index 0000000..59a23c4 --- /dev/null +++ b/_doc/README.adoc @@ -0,0 +1 @@ +../README \ No newline at end of file diff --git a/_doc/index.adoc b/_doc/index.adoc new file mode 100644 index 0000000..c671d51 --- /dev/null +++ b/_doc/index.adoc @@ -0,0 +1,25 @@ += haminer +:toc: +:sectanchors: +:sectlinks: + +Welcome to haminer. + +haminer is a library and a program to write static web server with embedded +files using AsciiDoc markup format. + +== Documentation + +link:CHANGELOG.html[CHANGELOG^]:: History of each release. + +link:README.html[README^]:: User manual page for haminer. + +== Development + +https://git.sr.ht/~shulhan/haminer[Repository^]:: Link to the source code. + +https://lists.sr.ht/~shulhan/public-inbox[Mailing list^]:: Link to development +and discussion. + +https://todo.sr.ht/~shulhan/haminer[Issues^]:: Link to submit an issue, +feedback, or request for new feature. -- cgit v1.3