-- Regards, Janmejay PS: Please blame the typos in this mail on my phone's uncivilized soft keyboard sporting it's not-so-smart-assist technology.
On Oct 14, 2014 11:33 AM, "Rainer Gerhards" <[email protected]> wrote: > > just beginning to catch up... > > 2014-10-13 17:29 GMT+02:00 singh.janmejay <[email protected]>: > > > Hi, > > > > Have added 3 functions to rainerscript: > > > > cool! > > > > - replace(operand, substring_to_be_replaced, its_replacement) > > - wrap(operand, string_to_wrap_around_it) > > > > - concat(operand_1, operand_2) > > > > > I think you overlooked the concatenation operation. you can simply do > > operand1 & operand2 > > eg: "foo" & "bar" ==> "foobar" > > I think concat() is equivalent to this. Am I right? > It is the same. I didn't know it was available as an operator, my bad. Will remove the concat implementation in the reworked patch. > Rainer > > > > > > Examples: > > replace("foo bar baz", "ba", "BA") => "foo BAr BAz" > > concat("foo", "bar") => "foobar" > > wrap("hello", "__") => "__hello__" > > replace("foo bar", concat("b", "ar"), wrap("baz", "*")) => "foo *baz*" > > > > I felt the need for this while working on some unstructured -> structured > > transformation of log-messages. Searched the forums a little, for instance: > > > > http://kb.monitorware.com/modify-message-string-strip-addresses-from-logs-t1610.html > > and found that nothing equivalent existed, hence the patch. > > > > 0001-... has replace and wrap impl > > 0002-... has concat impl > > (the patches go in the same order) > > > > Im currently running an large installation with these patches applied over > > 8.4.0, they seem to be working fine. > > > > If the patches look good for merging, I'll be happy to update the > > documentation(actually don't know how to update doc yet, will have to dig > > in to learn more about it). > > > > -- > > Regards, > > Janmejay > > http://codehunk.wordpress.com > > > > _______________________________________________ > > 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. > > > _______________________________________________ > 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. _______________________________________________ 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.

