首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >弹性预警格式项目列表

弹性预警格式项目列表
EN

Stack Overflow用户
提问于 2019-07-26 05:56:36
回答 1查看 43关注 0票数 0

我有一个使用聚合从查询中检索到的项目列表。我想在我的电子邮件中打印这个项目列表,每个项目都显示在单独的一行上。现在,我可以打印所有内容,但所有内容都会一个接一个地出现,即file1.txt file2.txt。我希望它看起来像这样

代码语言:javascript
复制
file1.txt
file2.txt

下面是创建电子邮件的操作。

代码语言:javascript
复制
"actions": {
    "email_users": {
        "email": {
            "profile": "standard",
            "to": [
                "jcarpenter@mydomain.com"
            ],
            "subject": "File Identifier",
            "body": {
                "html": "<p>Files could not be identified due bad receiver id.  There were {{ctx.payload.hits.total}} files that could not be identified.</p> <ul><li>{{#ctx.payload.aggregations.file_name.buckets}}{{key}}{{/ctx.payload.aggregations.file_name.buckets}}</li></ul>"
            }
        }
    }

可以这样打印吗?

EN

回答 1

Stack Overflow用户

发布于 2019-07-26 21:41:20

我可以使用以下命令格式化这些项目。

代码语言:javascript
复制
"actions": {
"email_users": {
  "email": {
    "profile": "standard",
    "to": [
      "jcarpenter@mydomain.com"
    ],
    "subject": "File Identifier",
    "body": {
      "html": "<p>Files could not be identified due bad receiver id.  There were {{ctx.payload.hits.total}} files that could not be identified.</p> <div><ul>{{#ctx.payload.aggregations.file_name.buckets}}{{#key}}<li>{{.}}</li>{{/key}}{{/ctx.payload.aggregations.file_name.buckets}}</ul></div><p>These files have been sent to quarantine.</p>"
    }
  }
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57210617

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档