does set $.newmsg = replace(...);
and using the $.newmsg variable inside the template work? On first look it should... HTH Rainer El jue, 17 dic 2020 a las 18:34, Salvatore Totaro via rsyslog (<[email protected]>) escribió: > > Hi, > > I have a msg property made in this way: > > 1.5470373000e+05,nan,1.5060465000e+05,nan,2.1682000000e+02,nan,2.4761550000e+04,nan,1.6121420000e+04,nan > > In order to insert this row in my postgres db I use this template: > > template(name="energy_value" type="list" option.sql="on") { > constant(value="INSERT INTO energyvalue (datetime, made_by, Nh_T1, Nh_T2, > Ph_im_T1, Ph_im_T2, Ph_ex_T1, Ph_ex_T2, Qh_im_T1, Qh_im_T2, Qh_ex_T1, > Qh_ex_T2 ) values ('") > property(name="timereported" dateformat="pgsql" date.inUTC="on") > constant(value="','") > property(name="hostname") > constant(value="',") > property(name="msg") > constant(value=")") > } > > but postgresql has problem with nan value. The solution is to replace nan > token with ‘nan’::double precision > > I tried to use replace function but with no luck. What is the right way to > replace a regex like (N|nA|aN|n) with ‘nan’::double precision? > > thanks > Salvatore > > > _______________________________________________ > rsyslog mailing list > https://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 https://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.

