Kafka output plugin not working for windows builds
When building the windows client with the kafka output plugin, you run into the following issue
LINK : warning LNK4044: unrecognized option '/lpthread'; ignored
LINK : fatal error LNK1104: cannot open file 'libcrypto.lib'
NMAKE : fatal error U1077: '"C:\Program Files\CMake\bin\cmake.exe"' : return code '0xffffffff'
Steps to reproduce and ultimately fix are as follows:
Checkout the appropriate version of fluentbit source code from the repo
[fluent/fluent-bit](https://github.com/fluent/fluent-bit)
Update the file <fluentbit_repo>/cmake/windows-setup.cmake
In the entry for set(FLB_OUT_KAFKA, change the value from No to Yes
Generate the build files using cmake -DFLB_OUT_KAFKA=On -G "NMake Makefiles" ..
After running the command above, a couple files should have been generated in the build/ folder. For the files build/src/fluent-bit-bin.vcxproj and build/src/fluent-bit-shared.vcxproj, in the Link subtrees, in the AdditionalDependencies property, add the paths to libcrypto.lib and libssl.lib files (files should exist in your OpenSSL installation folder)
e.g. <AdditionalDependencies>(..............)C:\Program Files\OpenSSL-Win64\lib\libcrypto.lib;C:\Program Files\OpenSSL-Win64\lib\libssl.lib</AdditionalDependencies>
Run cmake --build .
The binary should have been generated in build/bin/Debug/fluent-bit.exe
@deanvz This issue is better suited for the fluent-bit repo vs. the documentation repo
@elenacbc I think that maybe I should just create a PR with no intention of merging it so that the steps for how to go about getting the kafka output plugin working properly when building from source for windows. Any suggestions of where you think would be the best place to have this live (even if just in this issue)?
@deanvz If you have a working solution or workaround, a PR for documentation is welcome.