elasticsearch - Logstash Elastic Cloud 401 未经授权的错误
问题描述
我的logstash.yml
样子:
cloud.id: "Test:testkey"
cloud.auth: "elastic:password"
前面有 2 个空格,最后没有空格,在""
这就是我所拥有的logstash.yml
,没有别的了,
我得到:
[2018-08-29T12:33:52,112][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"https://myserverurl:12345/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::BadResponseCodeError, :error=>"Got response code '401' contacting Elasticsearch at URL 'https://myserverurl:12345/'"}
my_config_file_name.conf
看起来像:
input{jdbc{...jdbc here... This works, as I see data in windows console}}
output {
stdout { codec => json_lines }
elasticsearch {
hosts => ["myserverurl:12345"]
index => "my_index"
# document_id => "%{brand}"
}
我正在做的是bin/logstash
在 windows上点击cmd
,
它从我在 conf 文件的输入中配置的数据库加载数据,然后显示错误,我想在 Cloud 上索引我的数据MySQL
,elasticsearch
我试用了 14 天并创建了一个测试索引,用于学习目的,因为我稍后必须部署它。我的管道看起来像:
- pipeline.id: my_id
path.config: "./config/conf_file_name.conf"
pipeline.workers: 1
如果日志不包含敏感数据,我也可以提供。
基本上我不想在云上
同步(计划检查)我的MYSQL
数据,即ElasticSearch
AWS
解决方案
输出应为:
elasticsearch {
hosts => ["https://yourhost:yourport/"]
user => "elastic"
password => "password"
# protocol => https
# port => "yourport"
index => "test_index"
# document_id => "%{table_id}"
#
- 表示
如下所述的评论:Configuring logstash with elastic cloud docs
部署应用程序时提供的文档不提供 jdbc 的配置,即使在设置文件中定义,jdbc 也需要用户和密码,即logstash.yml
推荐阅读
- powershell - 如何使用 PowerShell 脚本删除文本/日志文件的内容,直到第一次出现关键字
- sql-server - 将前一个值设置为 NULL 用于 LEAD 功能
- dynamics-crm - 我们可以使用 Azure DevOps Pipelines 在部署后禁用一些 Dynamics 365 自定义插件吗?
- javascript - 数字字段加减号按钮在页面加载后几秒钟内停止工作
- sql - 我无法从下面的查询中获得 max(reservation_date) 的最后日期。查询也需要很长时间
- mysql - 如何查询具有重复节点的闭包表的路径?
- hibernate - Hibernate 通过仅传递“父”实体的 id 创建 OneToMany 的子对象
- javascript - Slick Slider 不适用于 PHP 中的 Loop
- python-3.x - 运行 face_recognition 模型导致“python 已停止工作”
- jmeter - 是否可以在不提供附件的情况下使用 SMTP Sampler?