Elastic/OpenSearch:如何从_ingest/Pipeline创建新文档

发布于 2025-01-19 04:31:57 字数 820 浏览 1 评论 0原文

我正在使用 Elastic/Opensearch,并且想要在 _ingest/pipeline 的不同索引中创建一个新文档 我在 www 中没有找到任何帮助...

我的所有文档(filebeat)一开始都是由管道解析和修改的,比如说“StartPipeline”。 由传入文档的字段中的信息触发,假设“开始”,我想通过在不同的长期索引中创建新文档以特殊方式存储该值 - 以及来自触发文档的更多信息。

如果找到可能性,如何从控制台手动执行此操作(update_by_query / reindex / painlesscripts),但它必须由传入文档触发......

也许这更容易理解 - 在我的脑海中它看起来像那样。

PUT _ingest/pipeline/StartPipeline
{
  "description" : "create a document in/to a different index",
  "processors" : [ {
      "PutNewDoc" : {
        "if": "ctx.FieldThatTriggers== 'start'",
        "index": "DestinationIndex",
        "_id": "123",
        "document": { "message":"",
                      "script":"start", 
                      "server":"alpha
                      ...}
      }
  } ]
}

有人有想法吗? 抱歉,我不是母语人士,我来自德国

I am working with Elastic/Opensearch and want to create a new document in a different index out of an _ingest/pipeline
I found no help in the www...

All my documents (filebeat) get parsed and modified in the beginning by a pipline, lets say "StartPipeline".
Triggered by an information in a field of the incoming document, lets say "Start", I want to store that value in a special way by creating a new document in a different long-termindex - with some more information from the triggering document.

If found possibilities, how to do this manually from the console (update_by_query / reindex / painlesscripts) but it has to be triggered by an incoming document...

Perhaps this is easier to understand - in my head it looks like something like that.

PUT _ingest/pipeline/StartPipeline
{
  "description" : "create a document in/to a different index",
  "processors" : [ {
      "PutNewDoc" : {
        "if": "ctx.FieldThatTriggers== 'start'",
        "index": "DestinationIndex",
        "_id": "123",
        "document": { "message":"",
                      "script":"start", 
                      "server":"alpha
                      ...}
      }
  } ]
}

Does anyone has an idea?
And sorry, I am no native speaker, I am from Germany

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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