--[[ Copyright (c) 2026, Vsevolod Stakhov Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ]]-- local argparse = require "argparse" local rspamd_regexp = require "rspamd_regexp" local rspamd_ip = require "rspamd_ip" local log_utils = require "lua_log_utils" local ansicolors = require "ansicolors" local parser = argparse() :name "rspamadm mapstats" :description "Count Rspamd multimap matches by parsing log files" :help_description_margin(32) parser:argument "log" :description "Log file or directory to read (stdin if omitted)" :args "?" :default "" parser:option "-c --config" :description "Path to config file" :argname "" :default(rspamd_paths and rspamd_paths["CONFDIR"] and (rspamd_paths["CONFDIR"] .. "/" .. "rspamd.conf") or "/etc/rspamd/rspamd.conf") parser:option "--start" :description "Starting time for log parsing" :argname "