hi team, could someone please help with the follow...
# fluent-bit
s
hi team, could someone please help with the following queries - 1. how can we access log_file param defined in service section in custom golang output plugin. 2. Can we have some global param in config file which we can access in custom golang output plugin (dont want to have that param in output section) ?
hi @hhatake can you please help. ^^
h
Currently, there's no consideration to handle log_file in Golang plugins.
s
oh okay. thanks. and could you please help with the second query ?
h
Ah, Golang plugins only handle their specific configuration. So, it's not supported
s
h
No, it's not help. Just processing the dedicated specific sections for Golang plugins
s
ok. one more query - Can we extract “Match” / “tag” in golang output plugin during the FLBPluginInit ?
basically from here -
func FLBPluginInit(plugin unsafe.Pointer) int {
h
It depends on the contained real values on plugin.Pointer. But it's not including tag information because it's only handled during event ingestions, as far as I remembered correctly
s
ok. yeah atleast i could not fetch it using
output.FLBPluginConfigKey(plugin, "Match")
just like i am able to fetch other param.
p
Can't you just use the normal logger from FB to send it to the file?
s
Regarding 1) - Basically i Want do have some logfile rotation logic on that log_file. So the objective was if we can extract that value from config file in our output plugin code.
p
You want to use a custom plugin to do logrotate job?
s
No. that just additional logic wanted to add. Custom plugin is created for some other task.
we are using logrotate for rotating the log files. So the logfile path is to be mentioned in logrotate config. So was thinking of extracting log_file param from config and wanted to inject into the logrotate config.
Any idea how we can do ?
Or does fluentbit has anything inbuilt by which we can rotate ?