将动态生成的 AdaptiveCard 列表中的要点格式化为 Teams

问题描述 投票:0回答:0

我有一个

Watcher
动作来给
Teams
频道发消息。

为了创建嵌套项目符号列表,我将以下 TextBlock 添加到我的 AdaptiveCard 正文中:

"body":[
    {
        "type": "TextBlock",
        "text": "Found the following [events]({{ url }}:{{ port }}/app/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:{{ watcher_config.start_range }},to:{{ watcher_config.end_range }}))&_a=(columns:!(request),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'{{ watcher_index }}',key:query,negate:!f,type:custom,value:'%7B%22bool%22:%7B%22must%22:%5B%7B%22range%22:%7B%22@timestamp%22:%7B%22gte%22:%22{{ watcher_config.start_range }}%22,%22lt%22:%22{{ watcher_config.end_range }}%22%7D%7D%7D,%7B%22bool%22:%7B%22{{ watcher_config.regex_match }}%22:%5B%7B%22regexp%22:%7B%22request%22:%22{{ watcher_config.regex }}%22%7D%7D%5D%7D%7D,%7B%22bool%22:%7B%22must%22:%5B%7B%22range%22:%7B%22response%22:%7B%22gte%22:{{ watcher_config.start_response_status }},%22lt%22:{{ watcher_config.end_response_status }}%7D%7D%7D%5D%7D%7D%5D%7D%7D'),query:(bool:(must:!((range:('@timestamp':(gte:{{ watcher_config.start_range }},lt:{{ watcher_config.end_range }}))),(bool:({{watcher_config.regex_match  }}:!((regexp:(request:'{{ watcher_config.regex }}'))))),(bool:(must:!((range:(response:(gte:{{ watcher_config.start_response_status }},lt:{{ watcher_config.end_response_status }}))))))))))),index:'{{ watcher_index }}',interval:auto,query:(language:kuery,query:''),sort:!())) matching error responses in the last {{ watcher_config.interval }}: \\r - {{ '{{' }}#ctx.payload.aggregations.group_by_kong_route.buckets{{ '}}' }} {{ '{{' }}key{{ '}}' }} ({{ '{{' }}doc_count{{ '}}' }}) {{ '{{' }}#group_by_response_code.buckets{{ '}}' }} \\r    - {{ '{{' }}key{{ '}}' }} ({{ '{{' }}doc_count{{ '}}' }}) \\r {{ '{{' }}/group_by_response_code.buckets{{ '}}' }} \\r{{ '{{' }}/ctx.payload.aggregations.group_by_kong_route.buckets{{ '}}' }} \\r"
    }
]

我预计:

在最近 1 小时内发现以下事件匹配错误响应:

  • /我的应用程序/API/基本 (330)
    • 429 (221)
    • 404 (109)
  • /我的应用程序/自行车 (323)
    • 429 (214)
    • 404 (109)
  • /myapp/rest/build (147)
    • 429 (81)
    • 404 (64)
    • 403 (2)
  • /myapp/自行车/532669 (122)
    • 429 (90)
    • 404 (32)
  • /myapp/自行车/制造 (84)
    • 429 (84)

相反,我得到这个:

  • /我的应用程序/API/基本 (330)
    • 429 (221)
    • 404 (109)

/我的应用程序/自行车 (323)

-429 (214)

-404 (109)

/myapp/rest/build (147)

-429 (81)

-404 (64)

-403 (2)

/myapp/bike/532669 (122)

-429 (90)

-404 (32)

/myapp/bike/make (84)

-429 (84)

我该如何解决?

microsoft-teams adaptive-cards text-formatting adaptive-design elasticsearch-watcher
© www.soinside.com 2019 - 2024. All rights reserved.