如何从S3 JSON文件对象创建Elasticsearch索引文档

发布于 2025-02-04 13:07:40 字数 1000 浏览 2 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文