os.date("%Y-%m-%dT%H:%M:%SZ", read_message("Timestamp") / 1e9)On Thu, Jul 2, 2015 at 1:10 PM, Ali <[email protected]> wrote: > Thanks, Jarek! > > Those are only useful if I'm writing a Go plug-in, correct? Is there any > way I can utilize such fancy time formatting libraries with a Lua > encoder/decoder? > > My basic problem in this situation is I'm reading logs with unusual > timestamp formats and sending them to services that require unusual (but > different!) timestamp formats. I thought it would be a piece of cake to do > this with Lua, but not being able to take advantage of existing time/date > libraries is making it seem much more complex. At this point, since I'm > interested in digging more into Go anyway, maybe it's worthwhile to just > write my encoders and decoders in Go. Looking at the Go plug-ins related > to Elasticsearch, however, did make me think that the level of effort would > still be high. > > -Ali > > On Mon, Jun 29, 2015 at 5:52 PM Jarek Śmiejczak <[email protected]> wrote: > >> Hi Ali, >> >> In latest stable version, heka uses "time" package and "Format" method to >> format strings with timestamp: >> >> https://github.com/mozilla-services/heka/blob/versions/0.9/plugins/elasticsearch/encoders.go#L284 >> >> https://github.com/mozilla-services/heka/blob/versions/0.9/plugins/elasticsearch/encoders.go#L410 >> >> >> That behaviour has been changed recently on dev and will be released with >> 0.10.0, heka started using github.com/cactus/gostrftime library to >> format timestamp string: >> >> https://github.com/mozilla-services/heka/blob/versions/0.10/plugins/elasticsearch/encoders.go#L313 >> >> However, initial load from Nanoseconds to time.Time struct is still done >> the same way. >> >> >> >> >> On Mon, Jun 29, 2015 at 7:26 PM, Ali <[email protected]> wrote: >> >>> Hi, all. >>> >>> I'm writing a custom output for Solr. The first input I'm using for >>> this is LogstreamerInput. It looks like the date being passed to the >>> Sandbox Encoder from read_message("Timestamp") is in nanoseconds. I'm >>> trying to figure out how to convert that to "YYYY-MM-DDThh:mm:ssZ" in the >>> payload. I see that the bundled Elasticsearch plug-ins do something >>> similar, but I've been unable to reverse engineer the good parts. :-) Any >>> help? >>> >>> TIA, >>> Ali >>> >>> _______________________________________________ >>> Heka mailing list >>> [email protected] >>> https://mail.mozilla.org/listinfo/heka >>> >>> >> >> >> -- >> jarek@reijutsu:~$ fortune >> You have Egyptian flu: you're going to be a mummy. >> jarek@reijutsu:~$ fortune >> You now have Asian Flu. >> > > _______________________________________________ > Heka mailing list > [email protected] > https://mail.mozilla.org/listinfo/heka > >
_______________________________________________ Heka mailing list [email protected] https://mail.mozilla.org/listinfo/heka

