- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在使用Logstash将索引之一从自托管的Elasticsearch迁移到Amazon ElasticSearch。成功迁移后,我们发现文档中添加了一些其他字段。我们如何防止它被添加
我们的Logstash配置文件
input {
elasticsearch {
hosts => ["https://staing-example.com:443"]
user => "userName"
password => "password"
index => "testingindex"
size => 100
scroll => "1m"
}
}
filter {
}
output {
amazon_es {
hosts => ["https://example.us-east-1.es.amazonaws.com:443"]
region => "us-east-1"
aws_access_key_id => "access_key_id"
aws_secret_access_key => "access_key_id"
index => "testingindex"
}
stdout{
codec => rubydebug
}
}
{
"_index": "testingindex",
"_type": "interaction-3",
"_id": "38b23e7a-eafd-4163-a9f0-e2d9ffd5d2cf",
"_score": 1,
"_source": {
"customerId" : [
"e177c1f8-1fbd-4b2e-82b8-760536e42742"
],
"customProperty" : {
"messageFrom" : [
"BOT"
]
},
"userId" : [
"e177c1f8-1fbd-4b2e-82b8-760536e42742"
],
"uniqueIdentifier" : "2b027fc0-a517-49a7-a71f-8732044cb249",
"accountId" : "724bee3e-38f8-4538-b944-f3e21c518437"
}
}
{
"_index" : "testingindex",
"_type" : "doc",
"_id" : "B-hP020Bd2lcvg9lTyBH",
"_score" : 1.0,
"_source" : {
"customerId" : [
"e177c1f8-1fbd-4b2e-82b8-760536e42742"
],
"customProperty" : {
"messageFrom" : [
"BOT"
]
},
"@version" : "1",
"userId" : [
"e177c1f8-1fbd-4b2e-82b8-760536e42742"
],
"@timestamp" : "2019-10-16T06:44:13.154Z",
"uniqueIdentifier" : "2b027fc0-a517-49a7-a71f-8732044cb249",
"accountId" : "724bee3e-38f8-4538-b944-f3e21c518437"
}
}
_type
和
_id
也会发生变化,我们需要
_type
和
_id
与自托管的Elasticsearch中的文档相同
最佳答案
字段@version
和@timestamp
由logstash生成,如果您不希望使用它们,则需要使用mutate过滤器将其删除。
mutate {
remove_fields => ["@version","@timestamp"]
}
_type
和
_id
,您将需要更改输入并添加
docinfo => true
选项,以将这些字段输入
@metadata
字段并在输出中使用它们,
documentation提供了一个示例。
input {
elasticsearch {
...
docinfo => true
}
output {
elasticsearch {
...
document_type => "%{[@metadata][_type]}"
document_id => "%{[@metadata][_id]}"
}
}
document_type
选项。
关于elasticsearch - Logstash:从一个 Elasticsearch 迁移到另一个 Elasticsearch 结果会带来一些其他属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58415965/
当我为我的项目运行“mvn dependency:tree”时,它显示如下: [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ x
我调用 ajax 的脚本 function search_func(value) { $.ajax({ type: "GET", url: "sample.php
我正在使用 SIM 安装 Sitecore 8.1,但在打开启动板时,由于 ajax 请求返回 HTTP 500 错误,出现了几个 Javascript 错误。查看开发人员工具会显示以下消息: htt
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
我有一张 table : +-----------+-------------+------+-----+---------+-------+| Field | Type | N
所以,我对这个阵列很生气,第 2 天让我感到疼痛 *.... 我正在开发面向对象的 PHP 脚本。 我得到一个数组: Array ( [0] => Project Object ( [project_
我正在尝试将我的一个 Rails 项目升级到 Ruby 1.9.2。一切进展顺利,但一个 RSpec 测试失败了。在这个测试中,我需要一个Ruby lib: # file spec/models/my
我可以使用 Maven 的插件 spring-boot:run 运行 Spring Boot,但是当我尝试执行打包的 jar 时,它给出: Error creating bean with name
我是一名优秀的程序员,十分优秀!