Mass changing Match Field What Objects

larsen

Well-Known Member
Feb 28, 2020
166
20
58
PMG 8.2 introduced a "New option for Match Field What Object, to restrict matching on the top header section".
See https://bugzilla.proxmox.com/show_bug.cgi?id=2709

I assume that it would be better (more performant) to only use recursive matching in special cases and to normally enable the checkbox "Only top level headers".
As we have several What objects containing ~50-100 Match Fields, I'd like to enable the checkbox for all of them.

How can I do this without having to manually check every item in the GUI?
(Couldn't find a config file)
 
I assume that it would be better (more performant) to only use recursive matching in special cases and to normally enable the checkbox "Only top level headers".
As we have several What objects containing ~50-100 Match Fields, I'd like to enable the checkbox for all of them.
If you haven't run into any performance-issues until now I would consider sticking with your current rules (compared to antivirus checks and SpamAssassin analysis the rule-system usually takes only a very small fraction of the runtime)


How can I do this without having to manually check every item in the GUI?
(Couldn't find a config file)
That's not easily possible/straight-forward - you can use pmgsh to generate and look through your what-objects - to get the IDs of the objects where you need to set the checkbox:
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/config/ruledb/what/{ogroup}/contenttype/{id}


I hope this helps!
 
  • Like
Reactions: larsen
That could only be used to get the ID, not to set anything, right?
Don't need the IDs as all of the rules currently don't have the checkbox enabled.

Is there a way to set the value for all of the rules?
 
That could only be used to get the ID, not to set anything, right?
with a POST/create request you can set the 'top-part-only' flag - but you need to read through all object-groups and find the objects which are affected and then adapt those - this is what I meant with - it's not really straight-forward
Is there a way to set the value for all of the rules?
no this is stored with each object and not a global flag

I hope this helps!
 
  • Like
Reactions: larsen