我对elasticsearch-kibana非常陌生,似乎找不到解决这个问题的方法。
我正在尝试创建我将在kibana中看到的索引,而不必使用Dev部分中的POST命令。
我已经做好测试了。
input {
file {
path => "/home/user/logs/server.log"
type => "test-type"
start_position => "beginning"
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "new-index"
}
}然后
来自logstash目录的bin/logstash -f test.conf
我得到的是在kibana (索引模式部分)中找不到新的索引,当我使用elasticsearch - http://localhost:9200/new-index/时,它会出现一个错误,当我去http://localhost:9600/ (它显示的端口)时,它似乎没有任何错误。
非常感谢你的帮助!
发布于 2017-01-10 11:22:23
实际上,我已经成功地创建了索引,即使没有在Kibana创建索引。
我使用了以下配置文件-
input {
file {
path => "/home/hadar/tmp/logs/server.log"
type => "test-type"
id => "NEWTRY"
start_position => "beginning"
}
}
filter {
grok {
match => { "message" => "%{YEAR:year}-%{MONTHNUM:month}-%{MONTHDAY:day} %{HOUR:hour}:%{MINUTE:minute}:%{SECOND:second} - %{LOGLEVEL:level} - %{WORD:scriptName}.%{WORD:scriptEND} - " }
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "new-index"
codec => line { format => "%{year}-%{month}-%{day} %{hour}:%{minute}:%{second} - %{level} - %{scriptName}.%{scriptEND} - \"%{message}\"" }
}
}我确保索引没有出现在Kibana中(我尝试使用其他索引名称来确定.)最终,我在Kibana (我在索引模式部分中添加了日志信息)和Elasticsearch中看到了包含日志信息的索引。
我唯一应该做的就是擦除在每次运行Logstash之后在data/plugins/inputs/file/下创建的data/plugins/inputs/file/文件。
或
另一种解决方案(仅用于测试环境)是将sincedb_path=>"/dev/null"添加到输入文件插件中,该插件指示不创建.sincedb_XXX文件。
发布于 2017-01-03 15:11:30
很明显,您将无法找到在Kibana中使用logstash创建的索引,除非您在Kibana的Managemen部分中手动创建索引。
请确保您具有使用logstash创建的标识的相同名称。看看文档,它传达了:
定义索引模式时,匹配该模式的索引必须存在于Elasticsearch中。这些指数必须包含数据。
这很大程度上意味着,在Kibana中创建索引时,应该存在标记。希望能帮上忙!
发布于 2018-08-23 05:00:44
您可以使用https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html在弹性搜索中直接创建索引,这些索引可以在Kibana使用。
https://stackoverflow.com/questions/41438866
复制相似问题