removed FLBTime because uint64 interface cannot be converted to int64#9
Open
guineveresaenger wants to merge 1 commit intofluent:masterfrom
Open
removed FLBTime because uint64 interface cannot be converted to int64#9guineveresaenger wants to merge 1 commit intofluent:masterfrom
guineveresaenger wants to merge 1 commit intofluent:masterfrom
Conversation
|
@guineveresaenger I faced the same issue, and i added the following code to prevent crashes: var timeStamp string
switch t := ts.(type) {
case output.FLBTime:
timeStamp = ts.(output.FLBTime).String()
case uint64:
timeStamp = time.Unix(int64(t), 0).Format(timeFormat)
default:
fmt.Print("given time is not in a known format, defaulting to now.\n")
timeStamp = time.Now().Format(timeFormat)
}See: https://github.com/majst01/fluent-bit-go-redis-output/blob/master/out_redis.go#L84 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The code as written cannot be converted into FLBTime. Unix time is consistently displayed in the Time field across plugins; perhaps this is an issue that can be addressed in fluent-bit code base?
Disclaimer: I'm a novice at golang and would be more than happy to learn about a different way to re-type the time and display it as human readable.