public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH v3 firewall 0/1] Optional `since` and `until` firewall log filtering
@ 2023-01-19 10:25 Christian Ebner
  2023-01-19 10:25 ` [pve-devel] [PATCH v3 firewall 1/1] api: Add optional parameters `since` and `until` for timestamp filter Christian Ebner
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Ebner @ 2023-01-19 10:25 UTC (permalink / raw)
  To: pve-devel

This patch introduces 2 optional api parameters `since` and `until` to
firewall log endpoints, in order to make them filterable.
Filtering of the firewall logs is performed by a callback function.

---

Changes since RFC version:
 - common: Use callback function filter instead of `since` `until` params
 - common: code reuse for `dump_logfile` and `dump_fw_logfile`
 - firewall: Style fixes and use of callback function

Changes since v1:
 - common: Store parameters needed for multiple `dump_logfile_by_filehandle`
    invocations in state hash.
 - common: Introduce `final` parameter to signal last invocation to
   `dump_logfile_by_filehandle`.
 - firewall: Moved `dump_fw_logfile` to firewall helper functions
 - firewall: Refactor of finding rotated logfiles by use of `dir_glob_foreach` and fixed regex.
 - firewall: Avoid error if opening logfile failes with ENOENT
 - Whitespace cleanup

Changes since v2:
 - use `qr//` syntax for regex in filter callback
 - deduplicate code by moving common filter logic to `dump_fw_logfile`
 - Fix off by one error in `filecount` for finding final file

Christian Ebner (1):
  api: Add optional parameters `since` and `until` for timestamp filter

 src/PVE/API2/Firewall/Host.pm | 16 ++++++-
 src/PVE/API2/Firewall/VM.pm   | 26 ++++++++++--
 src/PVE/Firewall/Helpers.pm   | 78 +++++++++++++++++++++++++++++++++++
 3 files changed, 115 insertions(+), 5 deletions(-)

-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-27 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 10:25 [pve-devel] [PATCH v3 firewall 0/1] Optional `since` and `until` firewall log filtering Christian Ebner
2023-01-19 10:25 ` [pve-devel] [PATCH v3 firewall 1/1] api: Add optional parameters `since` and `until` for timestamp filter Christian Ebner
2023-01-27 10:04   ` [pve-devel] applied: " Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal