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

FileBeat elasticsearch output, unable to add "host" to http headers #4842

Closed
zpoint opened this issue Aug 8, 2017 · 0 comments
Closed

FileBeat elasticsearch output, unable to add "host" to http headers #4842

zpoint opened this issue Aug 8, 2017 · 0 comments
Assignees

Comments

@zpoint
Copy link

zpoint commented Aug 8, 2017

configure file:

    headers:
        host: "datasearch"
        abc: "def"

I sniffer the network and find that "Abc" added to http header in every request,
but "Host" remains default value (someting like "120.76.205.241:8000")

I need to use specific value for "Host", or my elasticsearch server will return 404.

Already asked in
https://discuss.elastic.co/t/filebeat-elasticsearch-output-unable-to-add-host-to-http-headers/96073

@ph ph self-assigned this Oct 10, 2017
ph added a commit to ph/beats that referenced this issue Oct 12, 2017
Its common to be able to define the host header in an http request,
sadly golang's standard library will clear any `Host` defined key in the
header maps with the value of the `req.Host`, which will default to host
of the current machine.

This commits allow users to set the `Host` header key and the code will
pass this values to the `req.Host` method, this will make sure that on the
other hand of the connection the value of the header will be the
expected.

If not explicit value is set we will default to the standard library
behavior.

Fixes: elastic#4842
kvch pushed a commit that referenced this issue Oct 12, 2017
Its common to be able to define the host header in an http request,
sadly golang's standard library will clear any `Host` defined key in the
header maps with the value of the `req.Host`, which will default to host
of the current machine.

This commits allow users to set the `Host` header key and the code will
pass this values to the `req.Host` method, this will make sure that on the
other hand of the connection the value of the header will be the
expected.

If not explicit value is set we will default to the standard library
behavior.

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

No branches or pull requests

3 participants