logstash - 如何将表情符号作为 Logstash 的 HTTP-OUTPUT-PLUGIN 的一部分发送到 Telegram bot
问题描述
我想使用 http-output-plugin 将表情符号作为消息的一部分从 logstash 发送到电报机器人,并将其显示在电报组中。PFB 正在使用的代码。请建议。
http {
format => "json"
http_method => "post"
url => "https://api.telegram.org:443/bot481032672:AAGhbY0l6cuy_HXA-SyiJHbwRznPdA3KPaQ/sendMessage"
mapping => {
"chat_id" => "-191360460"
"text" => "Severity=%{SNMPv2-SMI::enterprises.111.15.3.1.1.5.1}
App Name=%{kpi_match_name}
RUEI KPI Name=%{SNMPv2-SMI::enterprises.111.15.3.1.1.14.1}
Current Value=%{kpi_cur_value}"
}
}
SY
解决方案
这对我有用。
添加
parse_mode: "HTML"
到您的“映射”数组。这会将文本呈现为 HTML。有关详细信息,请参阅https://core.telegram.org/bots/api#sendmessage。
- 将表情符号添加为“
推荐阅读
- java - 为什么我的列表中有额外的空元素?
- python - 合并和添加多维数组中的重复整数
- android - 动画将视图移动到错误的位置
- eclipse-plugin - 如何通过e4xmi添加带有按钮的工具栏
- powershell - powershell 使用 Sort-Object 按值对 json 进行排序
- android - 片段视图下方的键盘
- ios - Swift UITextField OneTimeCode 规范
- python - 与其他行相比,如何根据列表过滤系列?
- hive - %jdbc(hive) - 无法使用 JDBC Uri 打开客户端传输
- python - 将 dir() 函数显示为字典