From 8b7840d0ea79a9c750a131b3c7f13bf7899a73f9 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 15 Apr 2024 16:25:41 +0200 Subject: [PATCH] Using a limit in output results of bin/get-intern-used-from-addresses --- lib/pp_admintools/app/get_from_addr.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/pp_admintools/app/get_from_addr.py b/lib/pp_admintools/app/get_from_addr.py index 6313692..42f64b6 100644 --- a/lib/pp_admintools/app/get_from_addr.py +++ b/lib/pp_admintools/app/get_from_addr.py @@ -191,6 +191,8 @@ class GetFromAddressesApp(BaseDPXApplication): if getattr(self.args, 'show_address_results', False): self.show_address_results = True + self.limit = getattr(self.args, 'limit', self.default_limit) + if self.args.logfiles: self._eval_given_logfiles() else: @@ -448,6 +450,9 @@ class GetFromAddressesApp(BaseDPXApplication): lh_out = '' count = self.per_address[loghost][address] + if count < self.limit: + break + print(template.format(h=lh_out, a=address, c=count)) first = False @@ -494,6 +499,9 @@ class GetFromAddressesApp(BaseDPXApplication): lh_out = '' count = self.per_domain[loghost][domain] + if count < self.limit: + break + print(template.format(h=lh_out, d=domain, c=count)) first = False -- 2.39.5