deploy/platform/kubernetes/templates/feature-mysql-monitor/fluent-bit.yaml [109:166]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        jsonstr = table2json(re1)
        record["body"]={json={}}
        record["body"]["json"]["json"] = jsonstr
        return 1, timestamp, record
    end
    function split(input, delimiter)
        input = tostring(input)
        delimiter = tostring(delimiter)
        if (delimiter == "") then return false end
        local pos, arr = 0, {}
        for st, sp in function() return string.find(input, delimiter, pos, true) end do
            table.insert(arr, string.sub(input, pos, st - 1))
            pos = sp + 1
        end
        table.insert(arr, string.sub(input, pos))
        return arr
    end

    function uuid()
        local seed={'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}
        local tb={}
        for i=1,32 do
            table.insert(tb,seed[math.random(1,16)])
        end
        local sid=table.concat(tb)
        return string.format('%s-%s-%s-%s-%s',
            string.sub(sid,1,8),
            string.sub(sid,9,12),
            string.sub(sid,13,16),
            string.sub(sid,17,20),
            string.sub(sid,21,32)
        )
    end

    function table2json(t)
      local function serialize(tbl)
        local tmp = {}
        for k, v in pairs(tbl) do
          local k_type = type(k)
          local v_type = type(v)
          local key = (k_type == "string" and '"' .. k .. '":') or (k_type == "number" and "")
          local value =
            (v_type == "table" and serialize(v)) or (v_type == "boolean" and tostring(v)) or
            (v_type == "string" and '"' .. v .. '"') or
            (v_type == "number" and v)
          tmp[#tmp + 1] = key and value and tostring(key) .. tostring(value) or nil
        end
        if table.maxn(tbl) == 0 then
          return "{" .. table.concat(tmp, ",") .. "}"
        else
          return "[" .. table.concat(tmp, ",") .. "]"
        end
      end
      assert(type(t) == "table")
      return serialize(t)
    end

  fluent-bit-parser-conf: |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deploy/platform/kubernetes/templates/feature-postgresql-monitor/fluent-bit.yaml [87:144]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        jsonstr = table2json(re1)
        record["body"]={json={}}
        record["body"]["json"]["json"] = jsonstr
        return 1, timestamp, record
    end
    function split(input, delimiter)
        input = tostring(input)
        delimiter = tostring(delimiter)
        if (delimiter == "") then return false end
        local pos, arr = 0, {}
        for st, sp in function() return string.find(input, delimiter, pos, true) end do
            table.insert(arr, string.sub(input, pos, st - 1))
            pos = sp + 1
        end
        table.insert(arr, string.sub(input, pos))
        return arr
    end

    function uuid()
        local seed={'e','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'}
        local tb={}
        for i=1,32 do
            table.insert(tb,seed[math.random(1,16)])
        end
        local sid=table.concat(tb)
        return string.format('%s-%s-%s-%s-%s',
            string.sub(sid,1,8),
            string.sub(sid,9,12),
            string.sub(sid,13,16),
            string.sub(sid,17,20),
            string.sub(sid,21,32)
        )
    end

    function table2json(t)
      local function serialize(tbl)
        local tmp = {}
        for k, v in pairs(tbl) do
          local k_type = type(k)
          local v_type = type(v)
          local key = (k_type == "string" and '"' .. k .. '":') or (k_type == "number" and "")
          local value =
            (v_type == "table" and serialize(v)) or (v_type == "boolean" and tostring(v)) or
            (v_type == "string" and '"' .. v .. '"') or
            (v_type == "number" and v)
          tmp[#tmp + 1] = key and value and tostring(key) .. tostring(value) or nil
        end
        if table.maxn(tbl) == 0 then
          return "{" .. table.concat(tmp, ",") .. "}"
        else
          return "[" .. table.concat(tmp, ",") .. "]"
        end
      end
      assert(type(t) == "table")
      return serialize(t)
    end

  fluent-bit-parser-conf: |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



