Well,

I begin to hack ;-)

My plans:

new dateformat= date-mongodb
new entry in tpfFormattype: tplFmtMongoDbDate = 7

So modif in template.c, template.h

in tplToJSON :

condition FIELD + prop= PROP_TIMESTAMP or PROP_TIMEGENERATED and eDateFormat
== tplFmtMongoDbDate

->  ts_mongodb = ts_gen or ts_rcv 
   -> computing secfrac
      -> use json_object_new_int64  to store the  ts_mongodb value

in ommongodb.c:

nothing to modify !

;-)

the  computing of ts_mongodb is quite hugly because the code already in
ommobgodb.c is replicated here...
A new function in datetime.c should be added to remove this part from
template.c and ommongodb.c


Alain









Rainer Gerhards wrote
> On Thu, Feb 13, 2014 at 4:38 PM, ecze <

> eczema@

> > wrote:
> 
>> It sems that a little hack is necessary:
>>
>> 1. add a new properety in template ( ex: omgodate )
>>
>> 2. hack template.c to support this
>>
>> 3. hack ommongodb.c to support  bson_append_date()
>>
>>
> Yeah, you are right. It's not "cleanly" supported right now.
> 
> 
>> Alain
>>
>> I'll try to make this...
>>
>>
> That would be excellent!
> 
> Rainer
> _______________________________________________
> 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.





--
View this message in context: 
http://rsyslog-users.1305293.n2.nabble.com/About-DateFormat-in-a-template-for-ommongodb-tp7584362p7584396.html
Sent from the rsyslog-users mailing list archive at Nabble.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.

Reply via email to