a problem about unixtime

37 views
Skip to first unread message

李洋 周

unread,
Jun 18, 2014, 2:28:54 AM6/18/14
to flu...@googlegroups.com
the time in my log is a unixtime like 1402581844.

The config is below,I have no idea how to set time_formattime_slice_format.
Could u pls give me some advices?
Thanks!
<source>
type tail
path /tmp/zhou1.log
tag zhou2
format json
time_key log_t
time_format 
</source>

<match zhou2.**>
type file
path /tmp/12.log
flush_interval 1s
format json
time_slice_format %Y%m%d
time_format %Y%m%dT%H%M%S%z
</match>

李洋 周

unread,
Jun 18, 2014, 2:29:45 AM6/18/14
to flu...@googlegroups.com
BTW i tried to show the time as normal time

在 2014年6月18日星期三UTC+8下午2时28分54秒,李洋 周写道:

李洋 周

unread,
Jun 18, 2014, 4:48:50 AM6/18/14
to flu...@googlegroups.com
Actually I use in_tail and out_file,but how can i transform the unix timestamp to a normal timestamp in the object file.
1402581844  --->   Thu Jun 12 22:04:04 CST 2014


在 2014年6月18日星期三UTC+8下午2时29分45秒,李洋 周写道:

周李洋

unread,
Jun 18, 2014, 6:23:23 AM6/18/14
to fluentd, repea...@gmail.com
Hi Nakagawa-san

Could u pls give me some advices about this issue?

Thanks a lot.

best regard

--
You received this message because you are subscribed to the Google Groups "Fluentd Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fluentd+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kiyoto Tamura

unread,
Jun 18, 2014, 11:28:54 AM6/18/14
to flu...@googlegroups.com
Zhou-

No need to cc Masahiro here. He reads this mailing list more closely than anyone else in the world =)

So, your input file is line-delimited JSONs, right? Can you show me an example line from /tmp/zhou1.log?

Thanks,

Kiyoto
--
Check out Fluentd, the open source data collector for high-volume data streams

李洋 周

unread,
Jun 18, 2014, 9:46:21 PM6/18/14
to flu...@googlegroups.com
Hi 

{"name":"server","hostname":"TF2_web02","pid":19367,"level":50,"msg":"{\"err\":{\"code\":\"ECONNRESET\"},\"status\":\"res_undefined\",\"qs\":{\"log_t\":1402581844,\"app_id\":12000130,\"device_id\":\"0\",\"mobage_uid\":37940892,\"param1\":21,\"oauth_nonce\":\"baiao\",\"oauth_timestamp\":1402581844,\"sign\":\"m9Zxdr/QRTto+ML3TJU711o9U6I=\"},\"body\":\"{\\\"a_usr\\\":\\\"6@3794089200006\\\",\\\"a_typ\\\":\\\"Dmp104001\\\",\\\"a_tar\\\":{\\\"sweep\\\":false,\\\"times\\\":1,\\\"missionId\\\":200408,\\\"beforeLevel\\\":21,\\\"afterLevel\\\":21,\\\"win\\\":true,\\\"deckPower\\\":73440,\\\"deck_1_id\\\":11000001,\\\"deck_1_level\\\":18,\\\"deck_1_power\\\":14926,\\\"deck_2_id\\\":12000024,\\\"deck_2_level\\\":21,\\\"deck_2_power\\\":15413,\\\"deck_4_id\\\":52004,\\\"deck_4_level\\\":16,\\\"deck_4_power\\\":43101},\\\"a_rst\\\":[{\\\"obj\\\":\\\"Dmp:Energy\\\",\\\"before\\\":3,\\\"after\\\":2,\\\"diff\\\":-1},{\\\"obj\\\":\\\"Dmp:Gold\\\",\\\"before\\\":684886,\\\"after\\\":686589,\\\"diff\\\":1703},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"before\\\":12194,\\\"after\\\":12356,\\\"diff\\\":162},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000024#4\\\",\\\"before\\\":14059,\\\"after\\\":14215,\\\"diff\\\":156},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000057#5\\\",\\\"before\\\":6970,\\\"after\\\":7063,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000053#6\\\",\\\"before\\\":1959,\\\"after\\\":2052,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000054#7\\\",\\\"before\\\":3418,\\\"after\\\":3511,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@11000063#14\\\",\\\"before\\\":5782,\\\"after\\\":5875,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000004#21\\\",\\\"before\\\":7181,\\\"after\\\":7274,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000055#22\\\",\\\"before\\\":1959,\\\"after\\\":2052,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@12000056#23\\\",\\\"before\\\":4134,\\\"after\\\":4227,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Level\\\",\\\"subj\\\":\\\"Hero@12000056#23\\\",\\\"before\\\":16,\\\"after\\\":17,\\\"diff\\\":1},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@11000001#24\\\",\\\"before\\\":7419,\\\"after\\\":7575,\\\"diff\\\":156},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@11000059#32\\\",\\\"before\\\":1473,\\\"after\\\":1566,\\\"diff\\\":93},{\\\"obj\\\":\\\"Dmp:Exp\\\",\\\"subj\\\":\\\"Hero@11000061#34\\\",\\\"before\\\":1473,\\\"after\\\":1566,\\\"diff\\\":93},{\\\"obj\\\":\\\"Item@250102\\\",\\\"before\\\":10,\\\"after\\\":11,\\\"diff\\\":1}]}\"}","time":"2014-06-12T14:10:41.074Z","v":0}

Thanks for your help.


在 2014年6月18日星期三UTC+8下午11时28分54秒,kiyoto写道:
Reply all
Reply to author
Forward
0 new messages