logstash-plugins/logstash-output-http

json format with boolean attribute convert to string value

zzq0324 opened this issue · 0 comments

Logstash information:

  1. Logstash version: logstash 8.1.2
  2. Logstash installation source: expanded from tar or zip archive
  3. How is Logstash being run: Via command line
  4. How was the Logstash Plugin installed: by default

OS version (uname -a if on a Unix-like system)
Darwin zhengzhq 21.3.0 Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 arm64

Steps to reproduce:
I use http output plugin to send request to server, request body contains attributes and it's type is boolean. When request to server, it seems boolean value is convert to string, so the server response error.

  1. http output config info like below
http {
      format => "json"
      content_type => "application/json"
      http_method => "post"
      url => "https://open.feishu.cn/open-apis/bot/v2/hook/xxx"
      mapping => {
        msg_type => "interactive"
        card => {
          config => {
            wide_screen_mode => true
          }
          header => {
            template => "red"
            title => {
              content => "异常信息告警"
              tag => "plain_text"
            }
          }
        }
      }
    }
  1. server response
{"code":11246,"msg":"path: message->card; err_msg: json: cannot unmarshal string into Go struct field ConfigForm.config.wide_screen_mode of type bool; err_type: validation; ","data":{}}

anyone tell me how can i pass wide_screen_mode as boolean value to server?