Open thenoid opened 8 years ago
Could also easily implement backwards compatibility - detect if the current object is a hash, push it on to an array and save
Same problem for me. Think it would be a great idea to use array of hashes. In my case I would like to use different entries than in the default attribute files. I didn't find a way to prevent a deep merge of the default attributes. So I had do create a "hotfix". I deleted the default default_facility_logs entries in the attributes file and create new entries in the environment. Nicer would be what @thenoid suggested. +1 from my side
I would also vote for this, especially because of the need to sometimes precede or disable one of the default facilities. E.g. I want to be able to send all local7
logs to a different destination without having them show up in /var/log/syslog
but the current system makes that a bit clunky.
Like in most things, order matters within the rsyslog.conf - it would be swell if instead of a hash for the rsyslog.default_facility_logs and rsyslog.additional_directives it was an array of hashes, so that way line order could be easily specified.
Within each array, a simple sort would/should be applied to ensure random array storage doesn't cause the file to be needlessly regenerated. So the template would end up looking like
This would grant people to slice, push, pop, etc entries the way they wanted.
The defaults could still be implemented as hash, just the first hash in the array