python-elasticsearch-logger
python-elasticsearch-logger copied to clipboard
ImportError: cannot import name 'RequestsHttpConnection' from 'elasticsearch'
I am getting the following error when I try to use the package:
File "/usr/local/lib/python3.7/site-packages/elasticecslogging/handlers.py", line 14, in
from elasticsearch import Elasticsearch, RequestsHttpConnection ImportError: cannot import name 'RequestsHttpConnection' from 'elasticsearch' (/usr/local/lib/python3.7/site-packages/elasticsearch/init.py)
Here's my requirements.txt
:
ftrack-python-api==2.3.0
ElasticECSHandler==1.0.3
elasticsearch==8.6.2
requests==2.28.2
Hi,
As a quick W/A I have set elasticsearch to last 7.x version in PR #92.
Another, local W/A is to call:
pip uninstall elasticsearch
pip install elasticsearch==7.17.9
Hi @ffMathy
Did the recommended workaround from @thoscilo help?
I can't downgrade to 7 unfortunately.
@ffMathy, @drumadrian - I have managed locally fix this problem and update the usage of elasticsearch in version 8.X and successfully ingested logs to my ELK stack.
Right now I was able to test it with my custom auth method (LDAP with login and password provided directly - in plans to add as new PR too).
I will test other auth methods and create fix PR with result's.
@ffMathy, @drumadrian - you can check the #93 PR. It should fix the original problem reported.