On Mon, Jun 22, 2015 at 04:53:36PM +0200, Jonny Törnbom wrote: > On Thu, Jun 18, 2015 at 07:09:24PM +0200, David Lang wrote: > > On Thu, 18 Jun 2015, Jonny Törnbom wrote: > > > > > Hi, > > > > > > I have a patch proposal for the syslog severity text property: an > > > addition to make strings shorter than "warning" space padded up to the > > > width/length of said "warning". I thought at first about a generic > > > solution that could apply to any field, but by quickly looking at the > > > code and how it's handled, my impression was that it would require quite > > > a bit more work and seemed to increase complexity compared to this > > > solution. > > > > > > I imagine that the severity text is the one field (except for the msg > > > part) that actually changes width between messages in normal cases, so > > > that's why I chose the simplest solution I could imagine (and cheapest > > > since its strings literals). > > > > > > What do you guys think? > > > > most of the fields change length with different comments. I think the best > > thing > > to do would be to create a function that takes a string and a length and > > padds/truncates the string to that length. > > > > since the severity text is not used in any default templates, anyone who > > needs > > this is going to be creating their own template, so I think it's reasonable > > to > > have them set a variable and use that if they need fixed-width columns. > > > > the other option owuld be to modify the property replacer, I could see > > either an > > additional type or have it change how it interprets the 'end char' > > parameter so > > that if it's larger than the length of the string, it pads the string to > > that > > length (or possibly a combination where it only pads if the end char is > > longer > > than the string and the padstring option is provided as well) > > > > In any case, I don't see something specific to the severity text being the > > right > > answer. > > > > I agree. I walked through our old email conversation from 2013 about > this feature and think I implemented it as suggested back then (which is > in line with your suggestion here). Attaching an updated patch proposal > that adds a fixed-width option that space pads up to the toChar field if > string is shorter, does nothing if its equal or truncates if string is > longer than toChar. That is, behaves equal to a simple fromChar/toChar > just that it pads up to toChar if string is shorter. > > Feel free to to comment and if there's something obvious that I've > missed, let me know, the rsyslog code is rather new to me. >
Just a friendly ping to make sure the new patch didn't get lost. / Jonny _______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/ What's up with rsyslog? Follow https://twitter.com/rgerhards NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE THAT.

