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

FluentBit support HTTP input? #7008

Closed
Tamil-RK opened this issue Mar 12, 2023 · 11 comments
Closed

FluentBit support HTTP input? #7008

Tamil-RK opened this issue Mar 12, 2023 · 11 comments
Labels

Comments

@Tamil-RK
Copy link

Tamil-RK commented Mar 12, 2023

Does Fluentbit support HTTP input on windows platform(windows10)?

@Tamil-RK Tamil-RK changed the title Fluent Bit support HTTP input method? FluentBit support HTTP input? Mar 12, 2023
@patrick-stephens
Copy link
Contributor

It is not included in the default configuration:

set(FLB_IN_HTTP No)

This may be because it requires some inherent Linux capability or dependencies, or it may just not have been supported at the time but is now.

@leonardo-albertovich
Copy link
Collaborator

Mmm that's strange, I don't think it needs anything special and that could be something from the days where monkey wasn't working in windows so maybe we should reevaluate it.

@patrick-stephens
Copy link
Contributor

Mmm that's strange, I don't think it needs anything special and that could be something from the days where monkey wasn't working in windows so maybe we should reevaluate it.

We probably should look at the general set of Windows options with every major release I think. It should be easy to test, any PR will exercise it.

@leonardo-albertovich
Copy link
Collaborator

Definitely

@tszshingt
Copy link
Contributor

I found it odd to me too because HTTP Server is included in the build for Windows but not the HTTP input plugin. I tried to build with the HTTP input for Windows. It looks like these two lines were giving me issue with error of invalid operand for sizeof:

memset(&conn->session.parser, 0, sizeof(mk_http_parser));

memset(&conn->session.parser, 0, sizeof(mk_http_parser));

mk_http_parser is a function and the operand of sizeof cannot be function according to https://learn.microsoft.com/en-us/cpp/cpp/sizeof-operator?view=msvc-160#sample-output
It also didn't seem to make sense to me to reallocate the size of the mk_http_parser function to &conn->session.parser which is a reference to a type of struct also named mk_http_parser.
Do you think this is a typo? Could these lines of code mean to be memset(&conn->session.parser, 0, sizeof(struct mk_http_parser));? If so, would these lines be redundant since the function call mk_http_parser_init (which is called after the memset call) does exactly the same thing and more: https://github.com/fluent/fluent-bit/blob/64763f57d9dc209cde6a41f8aa3c303480123646/lib/monkey/include/monkey/mk_http_parser.h#LL314C20-L314C39
I removed those two lines and was able to build with the HTTP input plugin for Windows. The plugin seems to work fine on Windows.
Do you think removing those two lines would be okay? I really hope the HTTP input plugin can be included in the official Windows binary so that I don't have to re-build just to enable this plugin for Windows. Thank you!

@leonardo-albertovich
Copy link
Collaborator

You are absolutely correct, would you mind sending a PR with the change? If you look at in_opentelemetry or in_elasticsearch you'll notice that this error was fixed in those.

Additionally, if you decide to make the PR, I think the same change will be necessary in fluent-bit 2.0, would you like to create a backport PR yourself or to have a member of the team do it instead?

Thank you for taking the time to properly analyze it and submit your results, we really appreciate it.

@tszshingt
Copy link
Contributor

Thank you @leonardo-albertovich! I can create a PR but I don't know what is a backport PR nor how to create one 😅. Is there an example I could reference? Thank you!

@leonardo-albertovich
Copy link
Collaborator

My crude description : a backport is a pull request to apply a patch in an older version.

In this case you would create the PR in master (which is fluent-bit 2.1) and then you can either get the .patch file by appending .patch to the PR URL (eg. 7345), checkout the 2.0 branch, create a new branch and use git apply to apply that same patch.

I'm just mentioning it in case you want to learn how to do it / practice but it's by no means a requirement and we'd be more than happy to take care of it if it makes things easier for you.

@leonardo-albertovich
Copy link
Collaborator

As for a proper example of a backport this one made by Hiroshi is quite simple.

@tszshingt
Copy link
Contributor

Hi @leonardo-albertovich, I created the PR and the backport PR. Let me know if they look okay. Thank you! :)

@leonardo-albertovich
Copy link
Collaborator

Thank you very much for the contribution, I'm closing this issue because the issue has been solved.

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

No branches or pull requests

4 participants