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

Elasticsearchwriter: support Elasticsearch 8.0 #9251

Closed
pdolinic opened this issue Feb 22, 2022 · 7 comments · Fixed by #9812
Closed

Elasticsearchwriter: support Elasticsearch 8.0 #9251

pdolinic opened this issue Feb 22, 2022 · 7 comments · Fixed by #9812
Assignees
Labels
area/elastic Events to Elasticsearch enhancement New feature or request ref/NC
Milestone

Comments

@pdolinic
Copy link

pdolinic commented Feb 22, 2022

Describe the bug

[2022-02-22 18:18:51 +0100] critical/ElasticsearchWriter: Error: 'no handler found for uri [/icinga2-2022.02.22/doc/_bulk] and method [POST]'. Unexpected response code 400 from URL 'http://ip.ip.ip.ip:9200/icinga2-2022.02.22/doc/_bulk'

To Reproduce

  1. Install Elasticsearch 8.0
  2. Activate Elasticsearchwriter
  3. Check Output from "tail -f /var/log/icinga2/icinga2.log"

Expected behavior

Logs should not throw "critical/ElasticsearchWriter: Error: 'no handler found for uri"

Your Environment

  • Version used (icinga2 --version): version: 2.13.2-1
  • Operating System and version: RHEL8
  • Enabled features (icinga2 feature list): api checker command elasticsearch ido-mysql mainlog notification
  • Icinga Web 2 version and modules (System - About): 2.9.5

Additional context

"8.0 introduces several breaking changes to the Elasticsearch REST APIs... To make this process easier, we’ve added support for 7.x compatibility headers to our REST APIs. In many cases, these optional headers let you make 7.x-compatible requests to an 8.0 cluster and receive 7.x-compatible responses.. "

Sources:

https://www.elastic.co/guide/en/elasticsearch/reference/current/release-highlights.html
https://www.elastic.co/guide/en/elasticsearch/reference/8.0/rest-api-compatibility.html
https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html

@julianbrost julianbrost added the area/elastic Events to Elasticsearch label Mar 8, 2022
@cductive
Copy link

Hi,
I'm experiencing the same behavior with my implementation. Both the my Icinga2 and ELK setups are on separate VMs in the same network. I'm hoping someone can explain why this is happening and how to resolve it.

@Al2Klimov Al2Klimov changed the title Feature Elasticsearchwriter with Elasticsearch 8.0 throws Unexpected response code 400 Elasticsearchwriter: support Elasticsearch 8.0 Jul 5, 2022
@Al2Klimov Al2Klimov added the enhancement New feature or request label Jul 19, 2022
@zidludwig
Copy link

I'd need a update of this feature too!

@ThomasPause
Copy link

Hi,
experienced the same behaviour.

@pdolinic @cductive @zidludwig:
Suggestion for a fix:
just delete line 467 in this file:
https://github.com/Icinga/icinga2/blob/master/lib/perfdata/elasticsearchwriter.cpp

@Al2Klimov
for stable feature implementation maybe make the document type configurable and, if empty, leave it out in this line.
With this the code should be compatible with ElasticSearch 5-8 and OpenSearch 1 and 2.

@carraroj
Copy link

carraroj commented Feb 2, 2023

ref/NC/775717

@manny4566
Copy link

Hi, i have the same error with my Elasticsearchwriter test installation.
I think the problem is still existing or? Can somebody give me a feedback or a solution, if exists? Or the state of the issue?
Elastic v8.5.3

Thank you

@manny4566
Copy link

Hi, i have the same error with my Elasticsearchwriter test installation. I think the problem is still existing or? Can somebody give me a feedback or a solution, if exists? Or the state of the issue? Elastic v8.5.3

Thank you

Maybe the Problem is, that the Module try to create a index under the path "xxx/doc/_bulk"
Maybe "xxx/_doc" is correct under Elastic v8.

@FreeSoftwareServers
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/elastic Events to Elasticsearch enhancement New feature or request ref/NC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants