附加弹性搜索数据 [英] Appending Elasticsearch Data

查看:147
本文介绍了附加弹性搜索数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有与logstash-2015.12.10同名的弹性搜索索引。在不同的服务器上,有不同的数据。现在我只想要弹性搜索,所以需要将这两个服务器的数据附加到一个。
有可能吗?

解决方案

您可以将一个索引从一个主机复制到您的其他主机使用 Logstash 。使用下面的配置,确保更换源和目标主机以匹配您的主机名。



文件:copylogs.conf

  input {
elasticsearch {
hosts => server1:9200< ----您要从
中索引的主机index => logstash-2015.12.10
}
}
过滤器{
mutate {
remove_field => [@version,@timestamp]
}
}
输出{
elasticsearch {
host => server2< ---您要复制到的主机
port => 9200
协议=> http
manage_template => false
index => logstash-2015.12.10
}
}

然后你可以只需使用

  bin / logstash -f copylogs.conf 


I have Elasticsearch indices with the same name as logstash-2015.12.10. on different servers, with different data. Now I want only Elasticsearch so there is the requirement of appending this data of both servers into one. Is it possible to do it?

解决方案

You could copy one index from one host to the same index on your other host using Logstash. Using the configuration below, make sure to replace the source and target hosts to match your host names.

File: copylogs.conf

input {
  elasticsearch {
   hosts => "server1:9200"       <---- the host you want to copy from
   index => "logstash-2015.12.10"
  }
}
filter {
 mutate {
  remove_field => [ "@version", "@timestamp" ]
 }
}
output {
 elasticsearch {
   host => "server2"       <--- the host you want to copy to
   port => 9200
   protocol => "http"
   manage_template => false
   index => "logstash-2015.12.10"
 }
}

And then you can simply launch it with

bin/logstash -f copylogs.conf

这篇关于附加弹性搜索数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆