aboutsummaryrefslogtreecommitdiff
path: root/haminer.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-01-04 11:19:00 +0700
committerShulhan <ms@kilabit.info>2019-01-04 15:15:35 +0700
commitd7739491bdadf7b936095dcc2ba09f57e2f3a322 (patch)
treeccfdcc3e4042f4a976db57569a1037c4b59d4c76 /haminer.go
parent49e7d14699b299dffa835b2a9240e2f03e8d0dd3 (diff)
downloadhaminer-d7739491bdadf7b936095dcc2ba09f57e2f3a322.tar.xz
Add option to preprocess http_url
Diffstat (limited to 'haminer.go')
-rw-r--r--haminer.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/haminer.go b/haminer.go
index 245b4f1..3f62024 100644
--- a/haminer.go
+++ b/haminer.go
@@ -141,6 +141,13 @@ func (h *Haminer) forwards(halogs []*Halog) {
}
}
+func (h *Haminer) preprocess(halog *Halog) {
+ halog.tagHTTPURL = halog.HTTPURL
+ for _, retag := range h.cfg.retags {
+ halog.tagHTTPURL = retag.preprocess("http_url", halog.tagHTTPURL)
+ }
+}
+
func (h *Haminer) produce() {
halogs := make([]*Halog, 0)
@@ -150,6 +157,8 @@ func (h *Haminer) produce() {
continue
}
+ h.preprocess(halog)
+
halogs = append(halogs, halog)
if len(halogs) >= h.cfg.MaxBufferedLogs {