-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
YAML configuration files for Windows #6937
YAML configuration files for Windows #6937
Comments
Need libyaml and static linkage for it. |
See #7296 |
@mp3monster I think 2.1.3+ should have YAML support now. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days. Maintainers can add the |
Using a YAML config does not work with the latest Windows build zip from https://releases.fluentbit.io/2.1/fluent-bit-2.1.8-win64.zip. I'm testing with the sample config from https://github.com/fluent/fluent-bit/blob/master/packaging/testing/smoke/container/fluent-bit.yaml, but it returns the error |
Unless libyaml is installed, it is disabled: fluent-bit/cmake/windows-setup.cmake Line 24 in a2105c2
Currently we do not install it during Windows builds: https://github.com/fluent/fluent-bit/blob/master/.github/workflows/call-build-windows.yaml A PR to resolve that would be appreciated however it needs to ensure static linkage to libyaml as well, otherwise complaints about extra dependencies will be generated. |
This one just bit me as a new user and it was very confusing given the docs
Given that statement, and being a new user, I was very confused when I downloaded a v2.1.x Windows bin and repeatedly failed to read a YAML file. This was made worse by an unhelpful error message. |
Can you share an example of what didn't work for you? |
If YAML ain't supported on Windows, maybe the documentation should be corrected accordingly?
Yet Fluent Bit v2.2.0
* Copyright (C) 2015-2023 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2023/12/05 12:12:15] [error] [config] error in C:\Program Files\fluent-bit\conf\fluent-bit.yaml:1: undefined value - check config is in valid classic format
[2023/12/05 12:12:15] [error] configuration file contains errors, aborting. |
Is this an official Windows package because we do install libyaml when building those? If that's not working then it's a bug: fluent-bit/.github/workflows/call-build-windows.yaml Lines 143 to 146 in 323f343
If it's a custom build then you need to ensure you provide libyaml as well. YAML config should work for Windows is my understanding. |
If it's the Windows containers then that might be the issue as they need a bit of love and libyaml adding so a PR would be appreciated there: https://github.com/fluent/fluent-bit/blob/master/dockerfiles/Dockerfile.windows |
I installed via https://releases.fluentbit.io/2.2/fluent-bit-2.2.0-win64.exe |
It is statically linked, we cannot do anything else. At least that's the intent. @cosmo0920 it looks like we may need to revisit this. |
Sure, I'll revisit on this tomorrow. |
Ah, this is the AppVeyor builds I think which are deprecated and use their own CI config to build. @ng-bsy Could you try the Github ones from https://packages.fluentbit.io/windows/? |
Will give it a try 👍 |
Sadly, the same problem... |
Really? I tested fluent-bit 2.2.0 win64 zip and I obtained the following result. C:\Users\cosmo PS> cd .\fluent-bit-2.2.0-win64\fluent-bit-2.2.0-win64\
C:\Users\cosmo\fluent-bit-2.2.0-win64\fluent-bit-2.2.0-win64 PS> bin\fluent-bit -c C:\Users\cosmo\Documents\processors.yaml
Fluent Bit v2.2.0
* Copyright (C) 2015-2023 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2023/12/06 15:30:55] [ info] [fluent bit] version=2.2.0, commit=db8487d123, pid=8416
[2023/12/06 15:30:55] [ info] [storage] ver=1.5.1, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/12/06 15:30:55] [ info] [cmetrics] version=0.6.4
[2023/12/06 15:30:55] [ info] [ctraces ] version=0.3.1
[2023/12/06 15:30:55] [ info] [input:dummy:dummy.0] initializing
[2023/12/06 15:30:55] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2023/12/06 15:30:55] [ warn] [filter:rewrite_tag:rewrite_tag.0] 'Match' may cause infinite loop.
[2023/12/06 15:30:55] [ info] [input:emitter:re_emitted] initializing
[2023/12/06 15:30:55] [ info] [input:emitter:re_emitted] storage_strategy='memory' (memory only)
[2023/12/06 15:30:55] [ info] [sp] stream processor started
[2023/12/06 15:30:55] [ info] [output:stdout:stdout.0] worker #0 started
[0] from.test-tag.raw.new.fluent.bit.out: [[1701844256.091933250, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[0] from.test-tag.raw.new.fluent.bit.out: [[1701844257.098164081, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[0] from.test-tag.raw.new.fluent.bit.out: [[1701844258.092186450, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[0] from.test-tag.raw.new.fluent.bit.out: [[1701844259.093399524, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[2023/12/06 15:31:00] [engine] caught signal (SIGINT)
[0] from.test-tag.raw.new.fluent.bit.out: [[1701844260.098779201, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[0] from.test-tag.raw.new.fluent.bit.out: [[[2023/12/06 15:31:01] [ warn] [engine] service will shutdown in max 5 seconds
[2023/12/06 15:31:01] [ info] [input] pausing dummy.0
1701844261.099363327, {}], {"tag"=>"from.test-tag.raw.new.fluent.bit.out", "hostname"=>"monox", "output"=>"new data", "tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}}]
[2023/12/06 15:31:02] [ info] [engine] service has stopped (0 pending tasks)
[2023/12/06 15:31:02] [ info] [input] pausing dummy.0
[2023/12/06 15:31:02] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/12/06 15:31:02] [ info] [output:stdout:stdout.0] thread worker #0 stopped PS> type ~\Documents\processors.yaml pipeline:
inputs:
- name: dummy
tag: test-tag.raw
dummy: '{"tool": "fluent", "sub": {"s1": {"s2": "bit"}}}'
processors:
logs:
- name: modify
match: test-tag.*
add: hostname monox
- name: rewrite_tag
match_regex: ^test-tag.*
rule: $tool ^(fluent)$ from.$TAG.new.$tool.$sub['s1']['s2'].out false
emitter_name: re_emitted
- name: lua
match: from.test-tag.raw.*
call: append_tag
code: |
function append_tag(tag, timestamp, record)
new_record = record
new_record["tag"] = tag
return 1, timestamp, new_record
end
outputs:
- name: stdout
match: '*'
processors:
logs:
- name: lua
call: add_field
code: |
function add_field(tag, timestamp, record)
new_record = record
new_record["output"] = "new data"
return 1, timestamp, new_record
end |
Yep, sorry that one's on me. I reinstalled with the new package, while the fluent-bit executable was still running (service). In this case the docs, as pointed out earlier, should definitely be updated
|
Yeah we should update the docs, we switched over a while back but left the old docs there to keep compatible. We can do on next release potentially - I don't want to change checksum values in the docs without also changing version to make it obvious (and not stuck in a cache somewhere). I need to tweak the CI workflow slightly I think as well to inject the checksums from the Github builds (rather than AppVeyor ones) into the docs automatically too. @ng-bsy just to confirm: the packages from releases.fluentbit.io did not work but the ones from packages.fluentbit.io did? |
@patrick-stephens Exactly. Though I only tested the -win64.exe |
I also tested with -win32.exe and it works. |
winarm64.exe is also working as well. PS C:\Users\cosmo\fluent-bit-2.2.0-winarm64> .\bin\fluent-bit.exe -c ..\processors.yaml
Fluent Bit v2.2.0
* Copyright (C) 2015-2023 The Fluent Bit Authors
* Fluent Bit is a CNCF sub-project under the umbrella of Fluentd
* https://fluentbit.io
[2023/12/06 23:05:51] [error] [processor] error creating native processor instance lua
[2023/12/06 23:05:51] [error] cannot create 'lua' processor unit
[2023/12/06 23:05:51] [error] failed to load 'logs' processors
[2023/12/06 23:05:51] [error] [processor] error creating native processor instance lua
[2023/12/06 23:05:51] [error] cannot create 'lua' processor unit
[2023/12/06 23:05:51] [error] failed to load 'logs' processors
[2023/12/06 23:05:51] [ info] [fluent bit] version=2.2.0, commit=db8487d123, pid=5384
[2023/12/06 23:05:51] [ info] [storage] ver=1.5.1, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2023/12/06 23:05:51] [ info] [cmetrics] version=0.6.4
[2023/12/06 23:05:51] [ info] [ctraces ] version=0.3.1
[2023/12/06 23:05:51] [ info] [input:dummy:dummy.0] initializing
[2023/12/06 23:05:51] [ info] [input:dummy:dummy.0] storage_strategy='memory' (memory only)
[2023/12/06 23:05:51] [ warn] [filter:rewrite_tag:rewrite_tag.0] 'Match' may cause infinite loop.
[2023/12/06 23:05:51] [ info] [input:emitter:re_emitted] initializing
[2023/12/06 23:05:51] [ info] [input:emitter:re_emitted] storage_strategy='memory' (memory only)
[2023/12/06 23:05:51] [ info] [sp] stream processor started
[2023/12/06 23:05:51] [ info] [output:stdout:stdout.0] worker #0 started
[0] from.test-tag.raw.new.fluent.bit.out: [[1701871552.468503000, {}], {"tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}, "hostname"=>"monox"}]
[0] from.test-tag.raw.new.fluent.bit.out: [[1701871553.475230400, {}], {"tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}, "hostname"=>"monox"}]
[2023/12/06 23:05:55] [engine] caught signal (SIGINT)
[0] from.test-tag.raw.new.fluent.bit.out: [[1701871554.462450000, {}], {"tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}, "hostname"=>"monox"}]
[0] from.test-tag.raw.new.fluent.bit.out: [[[2023/12/06 23:05:55] [ warn] [engine] service will shutdown in max 5 seconds
1701871555.472658300, {}], {"tool"=>"fluent", "sub"=>{"s1"=>{"s2"=>"bit"}}, "hostname"=>"monox"}]
[2023/12/06 23:05:55] [ info] [input] pausing dummy.0
[2023/12/06 23:05:56] [ info] [engine] service has stopped (0 pending tasks)
[2023/12/06 23:05:56] [ info] [input] pausing dummy.0
[2023/12/06 23:05:56] [ info] [output:stdout:stdout.0] thread worker #0 stopping...
[2023/12/06 23:05:56] [ info] [output:stdout:stdout.0] thread worker #0 stopped |
Thanks @cosmo0920 |
I've created fluent/fluent-bit-docs#1270 to update the docs but it needs a CI update here as well to pass in the right hashes on next release: #8260 |
Is your feature request related to a problem? Please describe.
If YAML is to become the future format for configuration files it needs to be available for Windows deployments. Currently this isn't the case. The documentation about YAML doesn't indicate this. It would be worth including a note with the description of the configuration that it isn't a Windows option today
Describe the solution you'd like
The recommendation is to make YAML available for Windows. The min is to indicate it isn't a Windows option
Describe alternatives you've considered
documentation
Additional context
Development of book on Fluentbit - aim was to proof config using Windows before final examples being demonstrated, screenshots etc on Linux / Docker / K8s
The text was updated successfully, but these errors were encountered: