[heka] Timestamp Conversion

2015-03-14 Thread Madhukar Thota
I am trying to decode apache error logs using lua script. I was able to extract the fileds i needed but having problem with time conversion. my log timestamp is in the following format : [Sat Mar 14 23:42:45.990158 2015] in my lua script, i am converting timestamp as follows: local timestamp = l

Re: [heka] Timestamp Conversion

2015-03-14 Thread Michael Trinkala
Just remove the capture group and the timestamp variable will contain the value you want. local timestamp = l.P"[" * dt.build_strftime_grammar("%a %b %d %H:%M:%S.%s %Y") / dt.time_to_ns * "]" if timestamp then msg.Timestamp = timestamp end Trink On Sat, Mar 14, 2015 at 8:58 PM, Madhukar Thota w