Must-share information (formatted with Markdown):
- which versions are you using SonarQube 10.1.0-community
- how is SonarQube deployed: Docker
- what are you trying to achieve: parse server logs with fluentbit
- what have you tried so far to achieve this : see below
Hi,
I have one issue when parsing json logs of SonarQube using fluentbit. A small issue to be honest.
Things mostly work but the time format does not include trailing zeros when there are only zeros.
Example
{"process":"web","timestamp":"2023-08-17T09:50:57.999Z","severity":"INFO","logger":"org.sonar.server.platform.web.MasterServletFilter","message":"Initializing servlet filter org.sonar.server.platform.web.WebServiceReroutingFilter@7ad8fb8f [pattern=UrlPattern{inclusions=[/api/components/update_key, ...], exclusions=[]}]"}
{"process":"web","timestamp":"2023-08-17T09:50:58Z","severity":"INFO","logger":"org.sonar.server.platform.web.MasterServletFilter","message":"Initializing servlet filter org.sonar.server.authentication.DefaultAdminCredentialsVerifierFilter@2ae6cce1 [pattern=UrlPattern{inclusions=[/*], exclusions=[*.css, ...]}]"}
{"process":"web","timestamp":"2023-08-17T09:50:58Z","severity":"INFO","logger":"org.sonar.server.platform.web.MasterServletFilter","message":"Initializing servlet filter org.sonar.server.authentication.InitFilter@5fc4896c [pattern=UrlPattern{inclusions=[/sessions/init/*], exclusions=[]}]"}
{"process":"web","timestamp":"2023-08-17T09:50:58.001Z","severity":"INFO","logger":"org.sonar.server.platform.web.MasterServletFilter","message":"Initializing servlet filter org.sonar.server.authentication.SamlValidationRedirectionFilter@4
you can see
"timestamp":"2023-08-17T09:50:57.999Z"
"timestamp":"2023-08-17T09:50:58Z"
"timestamp":"2023-08-17T09:50:58.001Z"
So what, should you ask ?
Issue is, when trying to parse the time, I have to set a time format using strptime strptime(3) - Linux man page
see also Configuring Parser - Fluent Bit: Official Manual
so I set : %Y-%m-%dT%H:%M:%S.%L%z
but … it will fail to parse 2023-08-17T09:50:58Z
Would be very nice to have .000
added in this situation.
Kind regards,