ElasticSearch

Logstash mutate add all fields from json

岁酱吖の 提交于 2021-02-10 05:12:22
问题 I am using a Logstash plugin (logstash-input-rethinkdb). This plugin grabs all the edits in the database and outputs an json object containing the following structure: { "db":"itjobs", "table":"countries", "old_val":null, "new_val":{ "code":"USA3", "country":"USA3", "id":"7c8c9e4e-aa37-48f1-82a5d624cde4a3a0" }, "@version":"1", "@timestamp":"2016-12-19T19:54:08.263Z" } I insert this doc in elasticsearch. But the problem is that in elastic i get the same structure with -> new_val:{code:''} I

Logstash mutate add all fields from json

耗尽温柔 提交于 2021-02-10 05:06:37
问题 I am using a Logstash plugin (logstash-input-rethinkdb). This plugin grabs all the edits in the database and outputs an json object containing the following structure: { "db":"itjobs", "table":"countries", "old_val":null, "new_val":{ "code":"USA3", "country":"USA3", "id":"7c8c9e4e-aa37-48f1-82a5d624cde4a3a0" }, "@version":"1", "@timestamp":"2016-12-19T19:54:08.263Z" } I insert this doc in elasticsearch. But the problem is that in elastic i get the same structure with -> new_val:{code:''} I

Elasticsearch Java Rest Client: how to get the list of all indices

馋奶兔 提交于 2021-02-10 05:05:39
问题 How do I get the list of all indices in Elasticsearch using the Rest Client? (All answers I've found online seem to deal with the old type of client. I fail to find the direct answer in the doc, https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html can't figure out which section to look into, either Cluster or Index APIs etc.) 回答1: Via the REST API you can verify with this URL : http://elasticsearch:9200/_cat/indices?v Via the Java Client API (I just realised you

Elasticsearch Java Rest Client: how to get the list of all indices

試著忘記壹切 提交于 2021-02-10 05:03:51
问题 How do I get the list of all indices in Elasticsearch using the Rest Client? (All answers I've found online seem to deal with the old type of client. I fail to find the direct answer in the doc, https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html can't figure out which section to look into, either Cluster or Index APIs etc.) 回答1: Via the REST API you can verify with this URL : http://elasticsearch:9200/_cat/indices?v Via the Java Client API (I just realised you

parent/child relationship didn't work in ElasticSearch

不羁的心 提交于 2021-02-10 04:47:09
问题 how can I use parent/child relationship in ElasticSearch-7 all my documents have _doc type I want to implement something like the one shown below // index = `order_item` { "ID": 1, "Name": "Shoes", "Price": 9.99, "OrderID": 82 }, { "ID": 2, "Name": "Hat", "Price": 19.99, "OrderID": 82 } // index = `order` { "ID": 82, "Customer": "John Smith" } I want join these indices as below with parent/child relationship order { "ID": 82, "Customer": "John Smith", "order-item": [ { "ID": 1, "Name": "Shoes

parent/child relationship didn't work in ElasticSearch

蓝咒 提交于 2021-02-10 04:44:08
问题 how can I use parent/child relationship in ElasticSearch-7 all my documents have _doc type I want to implement something like the one shown below // index = `order_item` { "ID": 1, "Name": "Shoes", "Price": 9.99, "OrderID": 82 }, { "ID": 2, "Name": "Hat", "Price": 19.99, "OrderID": 82 } // index = `order` { "ID": 82, "Customer": "John Smith" } I want join these indices as below with parent/child relationship order { "ID": 82, "Customer": "John Smith", "order-item": [ { "ID": 1, "Name": "Shoes

parent/child relationship didn't work in ElasticSearch

走远了吗. 提交于 2021-02-10 04:44:06
问题 how can I use parent/child relationship in ElasticSearch-7 all my documents have _doc type I want to implement something like the one shown below // index = `order_item` { "ID": 1, "Name": "Shoes", "Price": 9.99, "OrderID": 82 }, { "ID": 2, "Name": "Hat", "Price": 19.99, "OrderID": 82 } // index = `order` { "ID": 82, "Customer": "John Smith" } I want join these indices as below with parent/child relationship order { "ID": 82, "Customer": "John Smith", "order-item": [ { "ID": 1, "Name": "Shoes

Kafka学习之路

一曲冷凌霜 提交于 2021-02-09 20:12:03
一直在思考写一些什么东西作为2017年开篇博客。突然看到一篇《Kafka学习之路》的博文,觉得十分应景,于是决定搬来这“他山之石”。虽然对于Kafka博客我一向坚持原创,不过这篇来自Confluent团队Gwen Shapira女士的博文实在精彩,所以还是翻译给大家,原文参见 这里 。 ~~~~~~~~~~~~ Kafka学习之路   看上去很多工程师都已经把“学习Kafka”加到了2017年的to-do列表中。这没什么惊讶的,毕竟Apache Kafka已经是一个很火的框架了。只需了解一些基本的Kafka技能我们便可以把消息队列应用到实际的业务系统中,集成应用程序和数据存储,构建流式处理系统并且着手搭建高伸缩性高容错性的微服务架构。所有的这些只需要学习Kafka这一个框架就足够了, 听起来还不错吧? 这篇报道 中Kafka上榜当选了当前最需要掌握的十大大数据技能之一( 译者:好吧, 这么吹我都有点受不了了,这篇报道中提到的技能几乎都是Amazon的,很难让人相信这不是Amazon的软文 ),所以如果你想在自己的领域内出人头地,Kafka值得一试!   好了,那么该如何开始学习Apache Kafka呢?一言以蔽之:因人而异!这取决于你的职业特点。学习Kafka可能有很多种方式,稍后我会详细向你介绍,不过这些方法都有相通的部分,所以让我们先从这些地方开始吧:  

Create a new index per day for Elasticsearch in Logstash configuration

天大地大妈咪最大 提交于 2021-02-08 19:53:48
问题 I intend to have an ELK stack setup where daily JSON inputs get stored in log files created, one for each date. My logstash shall listen to the input via these logs and store it to Elasticsearch at an index corresponding to the date of the log file entry. My logstash-output.conf goes something like: output { elasticsearch { host => localhost cluster => "elasticsearch_prod" index => "test" } } Thus, as for now, all the inputs to logstash get stored at index test of elasticsearch. What I want

Elasticsearch索引生命周期管理方案

我的梦境 提交于 2021-02-08 14:46:50
点击上方蓝色“ 方志朋 ”,选择“设为星标” 回复“ 666 ”获取独家整理的学习资料! 一、前言 在 Elasticsearch 的日常中,有很多如存储 「系统日志」 、 「行为数据」 等方面的应用场景,这些场景的特点是数据量非常大,并且随着时间的增长 索引 的数量也会持续增长,然而这些场景基本上只有最近一段时间的数据有使用价值或者会被经常使用(热数据),而历史数据几乎没有作用或者很少会被使用(冷数据),这个时候就需要对 索引 进行一定策略的维护管理甚至是删除清理,否则随着数据量越来越多除了浪费磁盘与内存空间之外,还会严重影响 Elasticsearch 的性能; 在 Elastic Stack 6.6 版本后推出了新功能 Index Lifecycle Management(索引生命周期管理) ,支持针对索引的全生命周期托管管理,并且在 Kibana 上也提供了一套 UI 界面来配置策略。本文主要介绍 Elasticsearch 索引生命周期管理如何配置和使用。 二、生命周期 2.1. 阶段介绍 索引生命周期分为4个阶段:hot、warm、cold、delete,其中hot主要负责对索引进行rollover操作。 rollover:滚动更新创建的新索引将添加到索引别名,并被指定为写索引。 「PS」 :4个阶段中只有hot阶段是必须的 索引根据时间参数min