elasticsearch X-Pack&;Logstash-没有输出到elasticsearch
我安装了X-Pack、Elasticsearch和Logstash。Logstash正在向elasticsearch报告X-Pack的监控部分elasticsearch X-Pack&;Logstash-没有输出到elasticsearch,elasticsearch,logstash,filebeat,xpack,elasticsearch,Logstash,Filebeat,Xpack,我安装了X-Pack、Elasticsearch和Logstash。Logstash正在向elasticsearch报告X-Pack的监控部分 现在我想让logstash通过管道的任何节拍来进行elasticsearch 我按照这个指南创建了上面提到的用户和角色。 我还为每个具有上述权限的beat类型创建了一个角色,并使用中的信息将角色分配给同一用户(例如,filebeat-*) 我的logstash.conf如下所示: input { beats { port => 504
现在我想让logstash通过管道的任何节拍来进行elasticsearch
我按照这个指南创建了上面提到的用户和角色。 我还为每个具有上述权限的beat类型创建了一个角色,并使用中的信息将角色分配给同一用户(例如,
filebeat-*
)
我的logstash.conf
如下所示:
input {
beats {
port => 5044
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
document_type => "%{[@metadata][type]}"
user => "user"
password => "pass-word"
}
file {
path => "C:\temp\%{[@metadata][beat]}-%{+YYYY.MM.dd}.log"
}
}
我正在创建文件(例如,为filebeat
),但elasticsearch中的索引未创建,并且elasticsearch中未显示任何数据
有人看到配置中是否有错误吗?几个小时以来,我一直在努力寻找错误/解决方案
使用上述用户将节拍直接发布到elasticsearch(无日志存储)正在工作(例如使用metricbeat
)
我也没有在日志中看到奇怪的东西,只是缺少对elastic的输出:
07:52:53.807[[main]>worker0]调试logstash.pipeline-筛选器收到{“事件”=>{…}}07:52:53.807[[main]>worker0]调试logstash.pipeline-筛选器收到{“事件”=>{…}}
07:52:53.807[[main]>worker0]调试logstash.pipeline-收到输出{“事件”=>{…}}
07:52:53.807[[main]>worker0]调试logstash.pipeline-收到输出{“事件”=>{…}}
07:52:53.870[[main]>worker0]调试logstash.outputs.file-文件,将事件写入文件。{:filename=>“C:/temp/filebeat-2017.04.11.log”}
07:52:53.870[[main]>worker0]调试logstash.outputs.file-文件,将事件写入文件。{:filename=>“C:/temp/filebeat-2017.04.11.log”}
07:52:53.870[[main]>worker0]INFO logstash.outputs.file-打开文件{:path=>“C:/temp/filebeat-2017.04.11.log”}
07:52:53.870[[main]>worker0]调试logstash.outputs.file-开始旧文件清理周期{:files=>{“C:/temp/filebeat-2017.04.11.log”=>#>}
07:52:53.870[[main]>worker0]调试logstash.outputs.file-找到0个陈旧文件{:inactive_files=>{}
已经谢谢你了
更新: 如果更改密码,则在日志存储日志中会出现以下错误: 08:22:33.877[[main]>worker1]错误logstash.outputs.elasticsearch-从服务器获取了错误的响应代码,但此代码被认为不可检索。请求将被删除{:code=>401,:response\u body=>“{”error\“:{”root\u cause\“:[{”type\”:“security\u exception\”,“reason\”:“无法对REST请求的用户[beat]进行身份验证[/\u bulk],“header\”:{“WWW authenticate\”:“Basic realm=\“security\”字符集=\\“UTF-8\”,“type\”:“security\u exception\”,“reason\”,“REST\”,“REST\”无法为REST请求[/\u bulk]\,“header\”:{“WWW authenticate\”:\“Basic realm=\\“security\\”charset=\\“UTF-8\\”\“\”},\“status\”:401},:请求体=>“{\”索引\“:{\“\u id\”:null,\“\u索引\”
因此,它似乎实际上是在与elasticsearch通信,但没有创建索引。不幸的是,我在elasticsearch日志中没有任何声明。为那些遇到类似问题的人自己找到了答案: 我的
elasticsearch.yml
中有一些关于操作的奇怪设置。auto\u create\u index
阻止创建索引
在将elasticsearch的日志级别更改为debug
之前提到的方式后,这变得可见
由于不需要这些,我删除了它们,现在一切正常。如果您安装了X-Pack,您仍然可以使用hosts=>[“不是https?”?