invalid time format for milliseconds

85 views
Skip to first unread message

sona sun

unread,
Dec 23, 2020, 8:49:31 AM12/23/20
to Fluentd Google Group
Hi
I'm getting invalid time format error for time with zero seconds and some milliseconds

<filter nokia.logging.json>
  @type parser
  key_name message
  <parse>
  @type json
  time_key time
  time_format %iso8601
  keep_time_key true
  </parse>
</filter>

2020-12-23 18:46:00 +0530 [warn]: #0 dump an error event: error_class=Fluent::Plugin::Parser::ParserError error="invalid time format: value = 2020-12-23T18:46+05:30, error_class = ArgumentError, error = invalid date: \"2020-12-23T18:46+05:30\"" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.4.2/lib/fluent/plugin/parser.rb:112:in `rescue in parse_time'" tag="nokia.logging.json" time=2020-12-23 18:46:00.002713286 +0530 record={"header"=>"yt\x02\x18", "message"=>"{\"host\":\"sps-ig-diameterapp-0\",\"level\":\"INFO\",\"log\":{\"classname\":\"com.alcatel.tpapps.common.common.metrics.DefaultMetricsPlugin:547\",\"message\":\"Starting metrics collection for interval (start time=2020-12-23T18:45:00.000+05:30, end time=2020-12-23T18:46:00.000+05:30).\",\"stacktrace\":\"\",\"threadname\":\"MetricsManager-DefaultMetricsPlugin-1\"},\"process\":\"collectMetrics\",\"service\":\"SERVER\",\"time\":\"2020-12-23T18:46+05:30\",\"timezone\":\"Asia/Kolkata\",\"type\":\"log\",\"system\":\"SPS_IG_AI_Punit\",\"systemid\":\"CBAM-3e3a79af0f64490a9f8d51d4fd74269f\"}"}
2020-12-23 18:48:00 +0530 [warn]: #0 dump an error event: error_class=Fluent::Plugin::Parser::ParserError error="invalid time format: value = 2020-12-23T18:48+05:30, error_class = ArgumentError, error = invalid date: \"2020-12-23T18:48+05:30\"" location="/opt/td-agent/embedded/lib/ruby/gems/2.4.0/gems/fluentd-1.4.2/lib/fluent/plugin/parser.rb:112:in `rescue in parse_time'" tag="nokia.logging.json" time=2020-12-23 18:48:00.003050775 +0530 record={"header"=>"yt\x02\x18", "message"=>"{\"host\":\"sps-ig-diameterapp-0\",\"level\":\"INFO\",\"log\":{\"classname\":\"com.alcatel.tpapps.common.common.metrics.DefaultMetricsPlugin:547\",\"message\":\"Starting metrics collection for interval (start time=2020-12-23T18:47:00.001+05:30, end time=2020-12-23T18:48:00.000+05:30).\",\"stacktrace\":\"\",\"threadname\":\"MetricsManager-DefaultMetricsPlugin-1\"},\"process\":\"collectMetrics\",\"service\":\"SERVER\",\"time\":\"2020-12-23T18:48+05:30\",\"timezone\":\"Asia/Kolkata\",\"type\":\"log\",\"system\":\"SPS_IG_AI_Punit\",\"systemid\":\"CBAM-3e3a79af0f64490a9f8d51d4fd74269f\"}"}

Kentaro Hayashi

unread,
Dec 23, 2020, 8:32:36 PM12/23/20
to Fluentd Google Group
Hi,

As error log indicates, you need to specify the correct time_format.
time with zero seconds and some milliseconds is not iso8601 compatible,
so you need to use time_format %FT%R%:z or something else.

Regards,


2020年12月23日水曜日 22:49:31 UTC+9 sonas...@gmail.com:

sona sun

unread,
Dec 24, 2020, 3:58:39 AM12/24/20
to flu...@googlegroups.com
This is hard to agree. Because your statement conflicts with the log below which was successfully parsed. Even after changing to many formats including yours, there is same error.

{"host":"sps-ig-smapp-0","level":"INFO","log":{"classname":"com.nokia.tpapps.servicemanager.services.current.impl.subscriber.SubscriberServiceImpl:2587","message":"addSubscriptions end for account AddProfileSubscriptionRequestDto{accountId='Account_Nokia', profileSubscriptionEntities=[ProfileSubscriptionEntity{entityType=DEVICE, entityId='Device_Nokia', subscriptions=[SubscriptionProfile{bundle=Bundle{name='Bundle_Nokia'}, feeOverride=null, activationTime=null, description=null, inputDate=null, maxRenewals=null, requestLifeCycles=null}]}], sendRar=true}","stacktrace":"","threadname":"IO-ThreadPool-57"},"process":"addSubscriptions","service":"SPS","time":"2020-12-24T13:17:00.040+05:30","timezone":"Asia/Kolkata","type":"log","system":"SPS_IG_AI_Punit","systemid":"CBAM-9eee017e6a24462eb1ccb9f648903670"}

--
You received this message because you are subscribed to a topic in the Google Groups "Fluentd Google Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/fluentd/aKftG3pyta4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to fluentd+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fluentd/09cde70d-af6a-4f02-8a1b-c4567652dc55n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages