From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1CD847315F for ; Wed, 6 Oct 2021 15:42:24 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0F7B9DC04 for ; Wed, 6 Oct 2021 15:42:24 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DFD8FDBF3 for ; Wed, 6 Oct 2021 15:42:22 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B3340457EA for ; Wed, 6 Oct 2021 15:42:22 +0200 (CEST) Message-ID: Date: Wed, 6 Oct 2021 15:41:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:93.0) Gecko/20100101 Thunderbird/93.0 Content-Language: en-US To: Stoiko Ivanov , Oguz Bektas Cc: pmg-devel@lists.proxmox.com References: <20211006114616.1131543-1-o.bektas@proxmox.com> <20211006152802.76d6f076@rosa.proxmox.com> From: Thomas Lamprecht In-Reply-To: <20211006152802.76d6f076@rosa.proxmox.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 1.198 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -1.964 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pmg-devel] [PATCH pmg-log-tracker] fix #3657: allow parsing mail.log files X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2021 13:42:24 -0000 On 06.10.21 15:28, Stoiko Ivanov wrote: > On Wed, 6 Oct 2021 13:51:53 +0200 > Thomas Lamprecht wrote: > >> On 06.10.21 13:46, Oguz Bektas wrote: >>> with an optional "--maillog" parameter, we parse /var/log/mail.log.* >>> instead of /var/log/syslog.* >> --mail-log >> >> and it may make sense to allow passing a base path to that, that would also allow easier >> evaluation like copy of the logs from the production system and run queries on another, >> not so important, system. > +1 for providing a base-path - I'd even go one further and let it deal > with the optionally gzipped logs by matching the filename (for .gz) > instead of the 'index' (assuming that the first and second file are not > compressed, and all consecutive files are). yeah we can also try either match on every, that way we can better cope with custom logrotation settings that may gzip only after .3 or so. All that would be relatively easy to do by implementing the iterator trait for a struct with a "base_path" member. > > With that (and the assumption that `logrotate` is used) this would > probably be usable in a configurable way for the GUI+Tracking Center) > > Question is from a UX point of view how much a '-i' for single logfile and > a '--mail-log' for a pattern of logfiles makes sense. > > You have a point there. First, generally my opinion is that not every option needs a short-op, as that is something that often leads to some weird excuses/arguments for a specific letter which a user may the see different. As input is `-i` or `--inputfile` it may be sensible to use --input-base or --input-series We already use minus as separator in a few places (--message-id, --queue-id, --search-string) so IMO cannot really care to much for consistency here, and I'd just avoid the short opt for this rather specific option.