Skip to content

Commit 3fd1e04

Browse files
l2dyedsiper
authored andcommitted
out_multiinstance: update to use FLBPluginExitCtx
Signed-off-by: Zero King <[email protected]>
1 parent b9c0d6a commit 3fd1e04

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This repository contains Go packages that allows to create [Fluent Bit][fluent-b
44

55
## Requirements
66

7-
The code of this package is intended to be used with [Fluent Bit v1.1][fluent-bit-1-1] branch or higher.
7+
The code of this package is intended to be used with [Fluent Bit v1.4][fluent-bit-1-4] branch or higher.
88

99
## Usage
1010

@@ -35,7 +35,7 @@ Feel free to join us on our Slack channel, Mailing List, IRC or Twitter:
3535
other [contributors][contributors].
3636

3737
[fluent-bit]: http://fluentbit.io/
38-
[fluent-bit-1-1]: https://github.com/fluent/fluent-bit/tree/v1.1.0
38+
[fluent-bit-1-4]: https://github.com/fluent/fluent-bit/tree/v1.4.0
3939
[multiinstance]: https://github.com/fluent/fluent-bit-go/tree/fc386d263885e50387dd0081a77adf4072e8e4b6/examples/out_multiinstance
4040
[fluent-bit-go]: http://github.com/fluent/fluent-bit-go
4141
[treasure-data]: http://treasuredata.com

examples/out_multiinstance/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Every output plugin go through four callbacks associated to different phases:
1111
| Registration | FLBPluginRegister() |
1212
| Initialization | FLBPluginInit() |
1313
| Runtime Flush | FLBPluginFlushCtx() |
14-
| Exit | FLBPluginExit() |
14+
| Exit | FLBPluginExitCtx() |
1515

1616
## Plugin Registration
1717

@@ -83,8 +83,8 @@ When done, there are three returning values available:
8383
When Fluent Bit will stop using the instance of the plugin, it will trigger the exit callback. e.g:
8484

8585
```go
86-
//export FLBPluginExit
87-
func FLBPluginExit() int {
86+
//export FLBPluginExitCtx
87+
func FLBPluginExitCtx(ctx unsafe.Pointer) int {
8888
return output.FLB_OK
8989
}
9090
```

examples/out_multiinstance/out.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
7272

7373
//export FLBPluginExit
7474
func FLBPluginExit() int {
75+
log.Print("[multiinstance] Exit called for unknown instance")
76+
return output.FLB_OK
77+
}
78+
79+
//export FLBPluginExitCtx
80+
func FLBPluginExitCtx(ctx unsafe.Pointer) int {
7581
return output.FLB_OK
7682
}
7783

0 commit comments

Comments
 (0)