Item Num        | state      | port       | dest address        | log type
{%
    for i, item in ipairs(ResData) do
        local num = item.MemberId .. string.rep(' ', (16 - string.len(item.MemberId))) .. '|'

        local state = ''
        if item.Enabled == true then
            state = ' enabled    |'
        else
            state = ' disabled   |'
        end

        local port = ' ' .. item.Port .. string.rep(' ', (11 - string.len(item.Port .. ''))) .. '|'

        local address = ''
        if string.len(item.Address) < 21 then
            address = ' ' .. item.Address .. string.rep(' ', (20 - string.len(item.Address))) .. '|'
        else
            address = ' ' .. item.Address ..  ' |'
        end

        local log_type = ''
        local log_table = {}
        if next(item.LogType) == nil then
            log_type = ' none'
        else
            for _, v in pairs(item.LogType) do
                if v == 'OperationLog' then
                    log_table['OperationLog'] = 'operationlogs'
                elseif v == 'SecurityLog' then
                    log_table['SecurityLog'] = 'securitylogs'
                elseif v == 'EventLog' then
                    log_table['EventLog'] = 'eventlogs'
                elseif v == 'IntrusionDetectionLog' then
                    log_table['IntrusionDetectionLog'] = 'intrusion_detectionlogs'
                end
            end

            if log_table['OperationLog'] == 'operationlogs' then
                log_type = log_type .. ' operationlogs'
            end
            if log_table['SecurityLog'] == 'securitylogs' then
                log_type = log_type .. ' securitylogs'
            end
            if log_table['EventLog'] == 'eventlogs' then
                log_type = log_type .. ' eventlogs'
            end
            if log_table['IntrusionDetectionLog'] == 'intrusion_detectionlogs' then
                log_type = log_type .. ' intrusion_detectionlogs'
            end
        end

        if i == #ResData then
            echo(num .. state .. port .. address .. log_type)
        else
            echo(num .. state .. port .. address .. log_type, '\n')
        end
    end
%}