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

[backport]Fix timestamp parsing compatibility issue for apsara log #1285 #1302

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

yyuuttaaoo
Copy link
Collaborator

This commit addresses a compatibility issue with timestamp parsing in apsara logs by ilogtail. Previously, ilogtail enforced a strict time format of %Y-%m-%d %H:%M:%S.%f, which resulted in failures when encountering apsara logs formatted with %Y-%m-%d %H:%M:%S,%f.

The fix introduces a more flexible parsing logic that disregards the character immediately following %S, allowing the parser to correctly handle sub-second parts denoted by any character. This patch also ensures that ilogtail can successfully parse timestamps without failing when the sub-second part is absent.



This commit addresses a compatibility issue with timestamp parsing in
apsara logs by ilogtail. Previously, ilogtail enforced a strict time
format of %Y-%m-%d %H:%M:%S.%f, which resulted in failures when
encountering apsara logs formatted with %Y-%m-%d %H:%M:%S,%f.

The fix introduces a more flexible parsing logic that disregards the
character immediately following %S, allowing the parser to correctly
handle sub-second parts denoted by any character. This patch also
ensures that ilogtail can successfully parse timestamps without failing
when the sub-second part is absent.
@yyuuttaaoo yyuuttaaoo merged commit 3e88b04 into 1.8 Jan 1, 2024
17 checks passed
@yyuuttaaoo yyuuttaaoo added the bug Something isn't working label Jan 1, 2024
@yyuuttaaoo yyuuttaaoo added this to the v1.8 milestone Jan 1, 2024
@yyuuttaaoo yyuuttaaoo deleted the backport/apsara_time branch January 1, 2024 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants