Bug 1600171 - Rsyslog omelasticsearch does not work with ES 6.x strict headers
Summary: Rsyslog omelasticsearch does not work with ES 6.x strict headers
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rsyslog
Version: 7.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 7.8
Assignee: Jiří Vymazal
QA Contact: Dalibor Pospíšil
Depends On:
Blocks: 1649308
TreeView+ depends on / blocked
Reported: 2018-07-11 15:06 UTC by Lukas Zapletal
Modified: 2020-03-31 19:10 UTC (History)
12 users (show)

Fixed In Version: rsyslog-8.24.0-48.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-03-31 19:10:09 UTC
Target Upstream Version:

Attachments (Terms of Use)
set content-type: application/json; charset=utf-8 (1.38 KB, patch)
2018-07-16 21:58 UTC, Rich Megginson
no flags Details | Diff

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:1000 0 None None None 2020-03-31 19:10:48 UTC

Description Lukas Zapletal 2018-07-11 15:06:38 UTC

# rpm -q rsyslog rsyslog-elasticsearch

Rsyslog in RHEL 7.5 is not able to push data into Elastic 6.x due to breaking API change - https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

It used to be opt-out, now in 6.x series this can't be configured anymore:

# curl -i -H "Content-Type: xxx" -XGET 'http://localhost:9200/' -d '{}\n'
HTTP/1.1 200 OK
Warning: 299 Elasticsearch-5.4.3-eed30a8 "Content type detection for rest requests is deprecated. Specify the content type using the [Content-Type] header." "Wed, 26 Jul 2017 14:33:28 GMT"

Now in 6.x:

# curl -i -H "Content-Type: xxx" -XGET 'http://localhost:9200/' -d '{}\n'
HTTP/1.1 406 Not Acceptable
content-type: application/json; charset=UTF-8
content-length: 74

{"error":"Content-Type header [xxx] is not supported","status":406}

Upstream does seem to send the header correctly, I request backport of this into RHEL7 please.



Comment 2 Lukas Zapletal 2018-07-11 15:09:53 UTC

Install RHEL 7.5 and:

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.3.1.rpm
rpm -i elasticsearch-oss-6.3.1.rpm
systemctl daemon-reload
systemctl enable elasticsearch.service
systemctl start elasticsearch.service

Create config:
template(name="viaq_template" type="list") {

And see es-errors.log:

        "request":      {
                "url":  "http://localhost:9200/project.foreman-2018-11-07/events",
                "postdata":     "{\"message\":\"Completed 200 OK in 20ms (Views: 1.3ms | ActiveRecord: 8.4ms)\\n\",\"level\":\"info\",\"hostname\":\"next\",\"@timestamp\":\"2018-07-11T16:08:47.980943+01:00\",\"systemd\":{\"t\":{\"MACHINE_ID\":\"ce37bff78932646b63dbb85e691a3808\",\"BOOT_ID\":\"0b261792c25849a4b028268ada1ae861\",\"CAP_EFFECTIVE\":\"0\",\"CMDLINE\":\"Passenger RackApp: \\/usr\\/share\\/foreman                                      \",\"COMM\":\"ruby\",\"EXE\":\"\\/opt\\/rh\\/rh-ruby24\\/root\\/usr\\/bin\\/ruby\",\"GID\":\"991\",\"HOSTNAME\":\"next.nat.lan\",\"PID\":\"2630\",\"SELINUX_CONTEXT\":\"system_u:system_r:passenger_t:s0\",\"SOURCE_REALTIME_TIMESTAMP\":\"1531321727980804\",\"SYSTEMD_CGROUP\":\"\\/system.slice\\/httpd.service\",\"SYSTEMD_SLICE\":\"system.slice\",\"SYSTEMD_UNIT\":\"httpd.service\",\"TRANSPORT\":\"journal\",\"UID\":\"993\"},\"u\":{\"SYSLOG_FACILITY\":\"176\",\"SYSLOG_IDENTIFIER\":\"foreman\"}},\"MESSAGE\":\"Completed 200 OK in 20ms (Views: 1.3ms | ActiveRecord: 8.4ms)\\n\",\"msg\":\"Completed 200 OK in 20ms (Views: 1.3ms | ActiveRecord: 8.4ms)\",\"foreman\":{\"logger\":\"app\",\"user_login\":\"admin\",\"remote_ip\":\"\",\"request\":\"6c3cbb4b-e731-4481-9060-63d57d719dbb\",\"session\":\"61feb0a7-479a-40cd-a4f2-50a365258734\"}}"
        "reply":        {
                "error":        "Content-Type header [text/json; charset=utf-8] is not supported",
                "status":       406

Comment 3 Lukas Vlcek 2018-07-11 15:15:23 UTC
I think we already have ticket for it here: https://github.com/openshift/origin-aggregated-logging/issues/625

This will be implemented once we upgrade to ES 6.x I would not expect us to implement it before we finish upgrade to ES 5.x

Comment 4 Rich Megginson 2018-07-16 21:58:54 UTC
Created attachment 1459274 [details]
set content-type: application/json; charset=utf-8

Comment 7 Jonas Steinberg 2018-11-02 19:30:13 UTC
Is there any update on this?  It's effecting my ES 6 infrastructure.  I'd be happy to help in any way that I can.

Comment 8 Jiří Vymazal 2019-03-26 09:23:27 UTC
This issue was not selected to be included either in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small amount of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.

Comment 10 Rich Megginson 2019-08-05 21:50:17 UTC
Shirly, Martin - FYI

Comment 45 errata-xmlrpc 2020-03-31 19:10:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.