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

failed to output.GetRecord(dec) #72

Open
rfyiamcool opened this issue Nov 29, 2023 · 2 comments
Open

failed to output.GetRecord(dec) #72

rfyiamcool opened this issue Nov 29, 2023 · 2 comments

Comments

@rfyiamcool
Copy link

summary

https://github.com/fluent/fluent-bit-go/blob/master/examples/out_multiinstance/out.go#L45

I have a question about what scenario will fail to execute output.GetRecord(dec) ? 😁 Or, how do I print a decode failure log.

I want to know why it failed. 😁

//export FLBPluginFlushCtx
func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int {
	dec := output.NewDecoder(data, int(length))
	count := 0
	for {
		ret, ts, record := output.GetRecord(dec)
		if ret != 0 {
			break
		}
		...
}

thank u.

@l2dy
Copy link
Contributor

l2dy commented Nov 29, 2023

Please read the source code.

func GetRecord(dec *FLBDecoder) (ret int, ts interface{}, rec map[interface{}]interface{}) {

@rfyiamcool
Copy link
Author

Most of the time, I just ignore it ?

Please read the source code.

func GetRecord(dec *FLBDecoder) (ret int, ts interface{}, rec map[interface{}]interface{}) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants