You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/02/17 05:45:46 UTC

[GitHub] [apisix] zhendongcmss commented on a change in pull request #6256: feat(error-log-logger): add clickouse for error-log-logger

zhendongcmss commented on a change in pull request #6256:
URL: https://github.com/apache/apisix/pull/6256#discussion_r808693582



##########
File path: apisix/plugins/error-log-logger.lua
##########
@@ -214,6 +227,78 @@ local function send_to_skywalking(log_message)
 end
 
 
+local function send_to_clickhouse(log_message)
+    local err_msg
+    local res = true
+    local url_decoded = url.parse(config.clickhouse.endpoint_addr)
+    local host = url_decoded.host
+    local port = url_decoded.port
+    core.log.info("sending a batch logs to ", config.clickhouse.endpoint_addr)
+
+    if not port then
+        if url_decoded.scheme == "https" then
+            port = 443
+        else
+            port = 80
+        end
+    end
+
+    local httpc = http.new()
+    httpc:set_timeout(config.timeout * 1000)
+    local ok, err = httpc:connect(host, port)
+    if not ok then
+        return false, "failed to connect to host[" .. host .. "] port["
+            .. tostring(port) .. "] " .. err
+    end
+
+    if url_decoded.scheme == "https" then

Review comment:
       There need add a ssl_verify ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org