提问:布和纸怕什么?

社区日报 第385期 (2018-09-05)

社区日报千夜 发表了文章 • 0 个评论 • 1418 次浏览 • 2018-09-05 11:01 • 来自相关话题

1.Curator 从入门到实战
http://t.cn/RFX0HoV
2.论 Elasticsearch 数据建模的重要性
http://t.cn/RFOdWke
3.Elasticsearch 原理分析
http://t.cn/ReCN93k
 
​活动预告
1、Elastic 中国开发者大会门票发售中
https://conf.elasticsearch.cn/2018/shenzhen.html
2、Elastic Meetup 9月8日 北京线下交流活动免费报名中
https://elasticsearch.cn/article/759
 
编辑:江水
归档:https://elasticsearch.cn/article/788
订阅:https://tinyletter.com/elastic-daily
 

metricbeat配置了mysql但是在kibana中没有数据

Kibanazqc0512 回复了问题 • 3 人关注 • 2 个回复 • 3026 次浏览 • 2018-09-05 10:45 • 来自相关话题

kibana的dashboard背景颜色怎么修改

Kibanakinfeng 回复了问题 • 2 人关注 • 1 个回复 • 8199 次浏览 • 2018-09-05 10:37 • 来自相关话题

Elasticsearch的module中可以使用plugin中的jar么

Elasticsearchrochy 回复了问题 • 2 人关注 • 2 个回复 • 2303 次浏览 • 2018-09-05 09:32 • 来自相关话题

推荐kibana插件Cleaner 管理ES index TTL

Kibanatruman.p.du 发表了文章 • 0 个评论 • 3908 次浏览 • 2018-09-05 09:23 • 来自相关话题

Cleaner


这是一个管理index TTL 插件,精美UI,高效运维管理elasticsearch index助手

[https://github.com/TrumanDu/cleaner](https://github.com/TrumanDu/cleaner)
---

screenshots


![](https://github.com/TrumanDu/cl ... mo.gif)

config

  1. scheduleTime

    server job schedule period,unit second ,default value is 60 second.

    you can edit it. like: cleaner.scheduleTime: 100
  2. mergePattern

    merge pattern,default value is [^a-z]+$.

    you can edit it. like: cleaner.mergePattern: '[\d]{4}[-|\.|/][\d]{1,2}[-|\.|/][\d]{1,2}'

    development


    See the [kibana contributing guide](https://github.com/elastic/kib ... ING.md) for instructions setting up your development environment. Once you have completed that, use the following npm tasks.

    • npm start

      Start kibana and have it include this plugin

    • npm start -- --config kibana.yml

      You can pass any argument that you would normally send to bin/kibana by putting them after -- when running npm start

    • npm run build

      Build a distributable archive

    • npm run test:browser

      Run the browser tests in a real web browser

    • npm run test:server

      Run the server tests using mocha

      For more information about any of these commands run npm run ${task} -- --help.

如何在不知道关系型数据库表结构的情况下,利用.NET API将数据导入ES

Elasticsearchrochy 回复了问题 • 2 人关注 • 3 个回复 • 1998 次浏览 • 2018-09-04 20:09 • 来自相关话题

取字符串第一个

Logstashrochy 回复了问题 • 2 人关注 • 1 个回复 • 1769 次浏览 • 2018-09-04 19:51 • 来自相关话题

es集群中存在超过100G的大分片是,怎么才能见效这个分片的质量(reindex成本过高..)

Elasticsearchqw8613243 回复了问题 • 6 人关注 • 5 个回复 • 3002 次浏览 • 2018-09-04 18:25 • 来自相关话题

logstash kv插件解析日志时,日志value中包含field_split切割字符,导致value截取不完整。

Logstashqw8613243 回复了问题 • 3 人关注 • 2 个回复 • 6283 次浏览 • 2018-09-04 18:21 • 来自相关话题

logstash 导入 elasticsearch,elasticsearch-head集群概览会显示Unassigned

ElasticsearchJing Ye 回复了问题 • 3 人关注 • 3 个回复 • 2268 次浏览 • 2018-09-04 17:25 • 来自相关话题

es能在聚合结果中显示每个桶里文档内容吗?

Elasticsearchbsll 回复了问题 • 3 人关注 • 1 个回复 • 4040 次浏览 • 2018-09-04 17:01 • 来自相关话题

Filebeat在配置文件中配置了自身的日志输出,怎样修改日志输出的格式

Beatschzhty001 回复了问题 • 3 人关注 • 5 个回复 • 7544 次浏览 • 2018-09-04 16:36 • 来自相关话题

ES数据节点load负载过高

Elasticsearchlei2018 回复了问题 • 4 人关注 • 2 个回复 • 4044 次浏览 • 2018-09-04 14:47 • 来自相关话题

通过 metadata 使logstash配置更简洁

LogstashLeon J 发表了文章 • 0 个评论 • 10220 次浏览 • 2018-09-04 13:17 • 来自相关话题

从Logstash 1.5开始,我们可以在logstash配置中使用metadata。metadata不会在output中被序列化输出,这样我们便可以在metadata中添加一些临时的中间数据,而不需要去删除它。

我们可以通过以下方式来访问metadata:

<br /> [@metadata][foo]<br />



用例


假设我们有这样一条日志:

<br /> [2017-04-01 22:21:21] production.INFO: this is a test log message by leon<br />



我们可以在filter中使用grok来做解析:

ruby<br /> grok {<br /> match => { "message" => "\[%{TIMESTAMP_ISO8601:timestamp}\] %{DATA:env}\.%{DATA:log_level}: %{DATA:content}" }<br /> }<br />

解析的结果为

ruby<br /> {<br /> "env" => "production",<br /> "timestamp" => "2017-04-01 22:21:21",<br /> "log_level" => "INFO",<br /> "content" => "{\"message\":\"[2017-04-01 22:21:21] production.INFO: this is a test log message by leon\"}"<br /> }<br />



假设我们希望

  1. 能把log_level为INFO的日志丢弃掉,但又不想让该字段出现在最终的输出中
  2. 输出的索引名中能体现出env,但也不想让该字段出现在输出结果里

    对于1,一种方案是在输出之前通过mutate插件把不需要的字段删除掉,但是一旦这样的处理多了,会让配置文件变得“不干净”。

    通过 metadata,我们可以轻松地处理这些问题:

    ruby<br /> grok {<br /> match => { "message" => "\[%{TIMESTAMP_ISO8601:timestamp}\] %{DATA:[@metadata][env]}\.%{DATA:[@metadata][log_level]}: %{DATA:content}" }<br /> }<br /> <br /> if [@metadata][log_level] == "INFO"{<br /> drop{} <br /> }<br /> <br /> output{<br /> elasticsearch {<br /> hosts => ["127.0.0.1:9200"]<br /> index => "%{[@metadata][env]}-log-%{+YYYY.MM}"<br /> document_type => "_doc"<br /> }<br /> }<br />

    除了简化我们的配置文件、减少冗余字段意外,同时也能提高logstash的处理速度。





    Elasticsearch input插件


    有些插件会用到metadata这个特性,比如elasticsearch input插件:

    ```ruby
    input {
    elasticsearch {
    host => "127.0.0.1"

    把 ES document metadata (_index, _type, _id) 包存到 @metadata 中

    docinfo_in_metadata => true
    }
    }

    filter{
    ......
    }

    output {
    elasticsearch {
    document_id => "%{[@metadata][_id]}"
    index => "transformed-%{[@metadata][_index]}"
    type => "%{[@metadata][_type]}"
    }
    }
    ```



    调试


    一般来说metadata是不会出现在输出中的,除非使用 rubydebug codec 的方式输出:

    <br /> output { <br /> stdout { <br /> codec => rubydebug {<br /> metadata => true<br /> }<br /> }<br /> }<br />

    日志经过处理后输出中会包含:

    ruby<br /> {<br /> ....,<br /> "@metadata" => {<br /> "env" => "production",<br /> "log_level" => "INFO"<br /> }<br /> }<br />



    总结


    由上可见,metadata提供了一种简单、方便的方式来保存中间数据。这样一方面减少了logstash配置文件的复杂性:避免调用remove_field,另一方面也减少了输出中的一些不必要的数据。通过这篇对metadata的介绍,希望能对大家有所帮助。

    ![elasticTalk,qrcode](http://p8z8qq24s.bkt.clouddn.c ... 24.png)

社区日报 第384期 (2018-09-04)

社区日报kimichen123 发表了文章 • 0 个评论 • 1974 次浏览 • 2018-09-04 12:41 • 来自相关话题

1.Bulk 异常引发的 Elasticsearch 内存泄漏排查。
http://t.cn/RFBHC1p
2.使用elastichq监控Elasticsearch机器。
http://t.cn/RFBHHLy
3.使用ELK分析应用事件和日志。
http://t.cn/RFBHnLN

​活动预告
1、Elastic 中国开发者大会门票发售中
https://conf.elasticsearch.cn/2018/shenzhen.html
2、Elastic Meetup 9月8日 北京线下交流活动免费报名中
https://elasticsearch.cn/article/759

编辑:叮咚光军
归档:https://elasticsearch.cn/article/785
订阅:https://tinyletter.com/elastic-daily