From dd12cc68ba7eba221a246b29c79284a7de575cd3 Mon Sep 17 00:00:00 2001 From: arijitad Date: Mon, 10 Aug 2020 16:45:48 +0530 Subject: [PATCH] Update the config file. --- config.json | 53 ++++++++++++++++++++++++++++++++--------------------- settings.go | 6 +----- 2 files changed, 33 insertions(+), 26 deletions(-) diff --git a/config.json b/config.json index 5efe92c..7757a63 100644 --- a/config.json +++ b/config.json @@ -7,32 +7,42 @@ "recognize-tcp-sessions": false, "http-pprof": "", "input-dummy": null, - "OutputDummy": null, + "output-dummy": [ + "[]" + ], "output-stdout": false, "output-null": false, - "input-tcp": null, - "InputTCPConfig": { + "input-tcp": [ + "[]" + ], + "input-tcp-config": { "input-tcp-secure": false, "input-tcp-certificate": "", "input-tcp-certificate-key": "" }, - "output-tcp": null, - "OutputTCPConfig": { + "output-tcp": [ + "[]" + ], + "output-tcp-config": { "output-tcp-secure": false, "output-tcp-sticky": false }, "output-tcp-stats": false, - "input-file": null, + "input-file": [ + "[]" + ], "input-file-loop": false, - "output-file": null, - "OutputFileConfig": { + "output-file": [ + "[]" + ], + "output-file-config": { "output-file-flush-interval": 1000000000, "output-file-queue-limit": 256, "output-file-append": false, "output-file-buffer": "/tmp" }, "input_raw": null, - "InputRAWConfig": { + "input-raw-config": { "input-raw-engine": "libpcap", "input-raw-track-response": false, "input-raw-realip-header": "", @@ -41,7 +51,6 @@ "input-raw-bpf-filter": "", "input-raw-timestamp-type": "", "input-raw-immediate-mode": false, - "BufferSize": 0, "input-raw-override-snaplen": false, "input-raw-buffer-size": "0" }, @@ -49,35 +58,37 @@ "output-file-max-size-limit": "1TB", "copy-buffer-size": "5mb", "middleware": "", - "InputHTTP": null, - "output-http": null, + "input-http": null, + "output-http": [ + "[]" + ], "prettify-http": false, - "OutputHTTPConfig": { + "output-http-config": { "output-http-redirect-limit": 0, "output-http-stats": false, "output-http-workers-min": 0, "output-http-workers": 0, "output-http-stats-ms": 5000, - "Workers": 0, "output-http-queue-len": 1000, "output-http-elasticsearch": "", "output-http-timeout": 5000000000, "output-http-original-host": false, "output-http-response-buffer": 0, "output-http-compatibility-mode": false, - "RequestGroup": "", "output-http-debug": false, "output-http-track-response": false }, - "output-binary": null, - "OutputBinaryConfig": { + "output-binary": [ + "[]" + ], + "output-binary-config": { "output-binary-workers": 0, "output-binary-timeout": 0, "output-tcp-response-buffer": 0, "output-binary-debug": false, "output-binary-track-response": false }, - "ModifierConfig": { + "modifier-config": { "http-disallow-url": null, "http-allow-url": null, "http-rewrite-url": null, @@ -91,17 +102,17 @@ "http-set-header": null, "http-allow-method": null }, - "InputKafkaConfig": { + "input-kafka-config": { "input-kafka-host": "", "input-kafka-topic": "", "input-kafka-json-format": false }, - "OutputKafkaConfig": { + "output-kafka-config": { "output-kafka-host": "", "output-kafka-topic": "", "output-kafka-json-format": false }, "config-file": "config.json", "config-server-address": ":9999", - "config-remote-host": "http://localhost:8000" + "config-remote-host": "" } \ No newline at end of file diff --git a/settings.go b/settings.go index c5b7c38..bff179b 100644 --- a/settings.go +++ b/settings.go @@ -1297,10 +1297,6 @@ func flagz(res http.ResponseWriter, req *http.Request) { if req.Method == "POST" { res.Write([]byte(readAndUpdateConfig(req.Body).Error())) } - Settings.RLock() - data, _ := json.MarshalIndent(Settings, "", " ") - Settings.RUnlock() - res.Write(data) for k, v := range req.URL.Query() { if len(v) == 1 { @@ -1320,7 +1316,7 @@ func flagz(res http.ResponseWriter, req *http.Request) { res.Write([]byte(readAndUpdateConfig(req.Body).Error())) } Settings.RLock() - data, _ = json.MarshalIndent(Settings, "", " ") + data, _ := json.MarshalIndent(Settings, "", " ") Settings.RUnlock() res.Write(data)