如何从S3 JSON文件对象创建Elasticsearch索引文档
S3到Elasticsearch
我们在S3中有JSON文件,将S3 JSON对象运送到elasticsearch作为文档(S3中的一个JSON文件到一个文档eLasticsearch)
是一个文档)
推送S3 JSON对象(S3容器JSON文件),每个对象是一个文档),这里 是
input {
s3 {
access_key_id => "MY_KEY"
secret_access_key => "MY_SECRET"
bucket => "sthreetoes"
region => "ap-south-1"
codec => "json"
}
}
output {
elasticsearch {
hosts => "http://elasticsearch:9200"
index => "test-data"
}
}
我运行管道时的管道,Losgstash考虑将每个键值作为文档付款,以索引。
S3中的JSON对象
{
"id": 246,
"first_name": "Lell",
"last_name": "Bsel",
"email": "[email protected]",
"gender": "Female",
"ip_address": "12.12.12.8"
}
在运行LogStash管道索引时,将创建6个文档,将JSON中的每个键值对作为消息。
将JSON对象保存为单个文档的任何解决方案
S3 to Elasticsearch
We have JSON files in s3, ship the s3 JSON object to elasticsearch as a document(one json files in s3 to one document elasticsearch)
Push s3 JSON objects (s3 containers json files), each object will be one document)
Here is my pipeline
input {
s3 {
access_key_id => "MY_KEY"
secret_access_key => "MY_SECRET"
bucket => "sthreetoes"
region => "ap-south-1"
codec => "json"
}
}
output {
elasticsearch {
hosts => "http://elasticsearch:9200"
index => "test-data"
}
}
When I run the pipeline, losgstash is shipping to index considering each key-value paid as document.
json object in s3
{
"id": 246,
"first_name": "Lell",
"last_name": "Bsel",
"email": "[email protected]",
"gender": "Female",
"ip_address": "12.12.12.8"
}
When we run the logstash pipeline index is created with 6 documents considering each key-value pair in JSON as a message.
Any solution to save the JSON object as a single document
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论