-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to Parse Timestamp in OTEL Collector Filelog Receiver #34390
Comments
Pinging code owners for receiver/filelog: @djaglowski. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi, I was looking into this out of curiosity and found that golang's time.Parse function seems to require a format where the milliseconds part of the timestamp is prefixed with either Would it be an option to change the format of the time stamps in the logs to something like |
Thank you. |
Hello @vimal-oneway, just want to check, have you been able to test to see if @bacherfl's suggestion works for you? If so, can we close this issue? |
Hi @crobert-1 , By using OTTL functions, I was able to concatenate the time and milliseconds with a period, which allowed me to parse it into a timestamp. Here’s the code snippet I used: - set(attributes["timestamp_ms"], Concat([attributes["timestamp"], attributes["ms"]], ".")) This resolved the problem I was experiencing. Thank you for your support! |
Based on #34390 (comment), should the |
I can look into adding such a check |
**Description:** Check for unsupported fractional seconds directive when converting strptime time layout to native format. This is done to prevent parsing errors which occur due to a limitation of how timestamps are being parsed in go - for more context see this comment in the related issue: #34390 (comment) **Link to tracking Issue:** #34390 **Testing:** Added additional unit tests **Documentation:** TODO, probably will require a note in `regex_parser.md` --------- Signed-off-by: Florian Bacher <[email protected]>
Closing this based on the behavior being native to golang's time package, and because we've now added validation to detect it in #34459. |
…34459) **Description:** Check for unsupported fractional seconds directive when converting strptime time layout to native format. This is done to prevent parsing errors which occur due to a limitation of how timestamps are being parsed in go - for more context see this comment in the related issue: open-telemetry#34390 (comment) **Link to tracking Issue:** open-telemetry#34390 **Testing:** Added additional unit tests **Documentation:** TODO, probably will require a note in `regex_parser.md` --------- Signed-off-by: Florian Bacher <[email protected]>
Description
I am experiencing an issue with the OTEL Collector configuration where the filelog receiver is unable to parse timestamps from the log files. Below are the relevant configurations and the error message encountered:
OpenTelemetry Collector configuration
Input Logs
Steps to Reproduce:
Expected Result
The timestamp in the logs should be parsed correctly using the specified regex pattern and layout format.
Actual Result
Collector version
v0.104.0
Environment information
OS: Amazon Linux
The text was updated successfully, but these errors were encountered: