Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cant parse java timestamp #906

Open
zxzgl opened this issue Jul 11, 2023 · 1 comment
Open

cant parse java timestamp #906

zxzgl opened this issue Jul 11, 2023 · 1 comment

Comments

@zxzgl
Copy link

zxzgl commented Jul 11, 2023

like this,Tested under Elasticsearch
`{"@timestamp":"2023-07-11T09:37:08.926+0000","message":"Completed initialization in 1 ms","host":"rancher","severity":"INFO","thread":"http-nio-1205-exec-1","logger":"org.springframework.web.servlet.DispatcherServlet"}
{"index":{"_index":"logs-2023-07-11"}}
{"@timestamp":"2023-07-11T09:37:08.963+0000","message":"{log:eslogger}","host":"rancher","severity":"WARN","thread":"http-nio-1205-exec-1","logger":"com.example.demo.DemoApplication"}
{"index":{"_index":"logs-2023-07-11"}}
{"@timestamp":"2023-07-11T09:37:08.963+0000","message":"{log:eslogger}","host":"rancher","severity":"INFO","thread":"http-nio-1205-exec-1","logger":"com.example.demo.DemoApplication"}
{"index":{"_index":"logs-2023-07-11"}}
{"@timestamp":"2023-07-11T09:37:08.964+0000","message":"{log:eslogger}","host":"rancher","severity":"ERROR","thread":"http-nio-1205-exec-1","logger":"com.example.demo.DemoApplication"}

{"took":0,"errors":false,"error":"field [@timestamp] value [2023-07-11T09:37:08.924+0000] parse err: time format is [2006-01-02T15:04:05Z07:00] but the value [2023-07-11T09:37:08.924+0000] parse err: parsing time "2023-07-11T09:37:08.924+0000" as "2006-01-02T15:04:05Z07:00": cannot parse "+0000" as "Z07:00"","items":[{"index":{"_index":"logs-2023-07-11","_type":"_doc","_id":"200sJPP37wI","_version":1,"result":"created","status":200,"_shards":{"total":1,"successful":1,"failed":0},"_seq_no":85106,"_primary_term":1}}]}`

@fast01
Copy link

fast01 commented Dec 15, 2023

see time layouts from: https://pkg.go.dev/time#pkg-constants

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants