我有一个“ELK堆栈”的configuration,首先是执行标准的'filebeat'系统日志从logstash提供elasticsearch输出插件。 它工作得很好。
现在我已经添加了一个TCPinput端口(为这个数据分配“types”,以便在[type] ==“thistype”中区分filter),自己的grokfilter,并输出到两个elasticsearch索引名称和document_type名称和文件。 当数据通过TCP端口进入时,它将正确格式化的数据写入输出文件,如文件输出插件所期望的那样,但是当我select给定索引时,没有数据显示在Kibana中。 Kibana从我的输出configuration中识别索引,并列出我在grokfilter中分配的所有字段/键; 然而,再次,没有数据是可search的。 正如我所提到的那样,这些数据肯定是正确的,正好在文件插件输出中出现。
我在这里做错了什么? 我的configuration如下:
input { tcp { host => "10.1.1.10" port => 12345 type => "odata" id => "odata" codec => line } } filter { if [type] == "odata" { grok { match => { "message" => "%{QUOTEDSTRING:oid},\"%{WORD:oword1}\",\"%{IPV4:oclientip}\",\"%{DATA:otimestamp}\",%{QUOTEDSTRING:opl},%{QUOTEDSTRING:oos},%{QUOTEDSTRING:oua}" } remove_field => "message" } date { match => ["otimestamp", "YYYY-MM-dd HH:mm:ss Z"] } mutate { remove_field => "otimestamp" remove_field => "host" remove_field => "@version" } } } output { # the if .. is here because there are other types that are handled in this output since I centralize the input, filter, and output files to three distinct files. if [type] == "odata" { elasticsearch { hosts => ["10.1.1.1:9200", "10.1.1.2:9200"] sniffing => false index => "odataindex" document_type => "odatatype" } file { path => "/tmp/odata_output" } } }
再一次,grokfilter很好, 数据通过tcp摄入就好了; 和文件输出插件输出解释/ grokd领域罚款。 Kibana从grokfilter中看到“odataindex”索引和字段(如oid,oclientip,oua等)。 当我search时,它不会返回任何数据。
有任何想法吗? 我是新来的弹性/ kibana / logstash,也将不胜感激任何提示debugging这些事情。
先谢谢你!
不熟悉Kibana,我不知道15分钟内默认search/显示的时间限制。 进来的数据是通过'date'插件与原始开放date时间戳(@时间戳键),而不是通过TCP端口到弹性,插入事件的时间; 因此,没有数据显示,我不知道,默认情况下,只显示基于@timestamp的过去15分钟的数据。 如果我已经读了关于时间限制的部分,我会知道的。 所以我只是调整时间回到无限的岁月,看到了我的数据。
所以,如果其他人有这个问题,这可能是因为你创build了一个时间依赖的索引,并没有点击右上angular的“时间”button,并改变了时间框架。
这是我的朋友们为什么阅读手册!