微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

安装SearchGuard后,Elastalert无法连接到ES

如何解决安装SearchGuard后,Elastalert无法连接到ES

我有一个可以完全在docker(docker-compose)上运行的ELK堆栈

我还安装了SearchGuard,这是负责身份验证和角色/用户管理的ElasticSearch插件,我还安装了Elastalert,又是用于通过邮件等在某些情况下发出警报的Elasticsearch插件

我的问题是Elastalert无法连接到ElasticSearch,它会抛出

curl: (22) The requested URL returned error: 401
Waiting for ES,trying again in 5 seconds\n

我在SearchGuard上有演示users/roles,我的Elastalert configuration.yaml如下:

es_host: elasticsearch

# The elasticsearch port
es_port: 9200

es_username: admin
es_password: admin

# This is the folder that contains the rule yaml files
# Any .yaml file will be loaded as a rule
rules_folder: rules

# How often ElastAlert will query elasticsearch
# The unit can be anything from weeks to seconds
run_every:
  seconds: 30

# ElastAlert will buffer results from the most recent
# period of time,in case some log sources are not in real time
buffer_time:
  minutes: 1

# Optional URL prefix for elasticsearch
#es_url_prefix: elasticsearch

# Connect with TLS to elasticsearch
#use_ssl: True

# Verify TLS certificates
#verify_certs: True

# GET request with body is the default option for Elasticsearch.
# If it fails for some reason,you can pass 'GET','POST' or 'source'.
# See http://elasticsearch-py.readthedocs.io/en/master/connection.html?highlight=send_get_body_as#transport

# The index on es_host which is used for Metadata storage
# This can be a unmapped index,but it is recommended that you run
# elastalert-create-index to set a mapping
writeback_index: elastalert_status

# If an alert fails for some reason,ElastAlert will retry
# sending the alert until this time period has elapsed
alert_time_limit:
  days: 2

我尝试按照建议的here打开ssl / cert设置,但始终抛出相同的401错误

# Connect with TLS to elasticsearch
use_ssl: True

# Verify TLS certificates
verify_certs: True

感谢任何帮助,谢谢

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。