fix logs tail

This commit is contained in:
Eugenio Marzo
2023-01-12 18:31:45 +01:00
parent 15aa749e34
commit d8c4eeb62e
7 changed files with 20 additions and 12 deletions

View File

@@ -37,13 +37,10 @@ elseif ngx.var.request_method == "POST" and action == 'set' then
elseif ngx.var.request_method == "POST" and action == "set_log_regex" then
local body_data = ngx.req.get_body_data()
red:set("log_pod_regex:" .. arg['id'], body_data)
red:set("pods_match_regex:" .. arg['id'], "0")
red:set("programming_mode", "0")
ngx.say("Regex has been set => " .. body_data)
ngx.log(ngx.INFO, "Set Regex for web log tail. Log id " .. arg['id'])
--local redis_del_cmd = "(redis-cli KEYS 'regex_cmp:'" .. arg['id'] .. "| xargs redis-cli DEL) || echo"
--local handle = io.popen(redis_del_cmd)
--local result = handle:read("*a")
--local rc = handle:close()
return ngx.exit(ngx.status)
elseif ngx.var.request_method == "POST" and action == "enable_log_tail" then