Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

json format with boolean attribute convert to string value #134

Open
zzq0324 opened this issue Jun 14, 2022 · 0 comments
Open

json format with boolean attribute convert to string value #134

zzq0324 opened this issue Jun 14, 2022 · 0 comments
Labels

Comments

@zzq0324
Copy link

zzq0324 commented Jun 14, 2022

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?

@zzq0324 zzq0324 added the bug label Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant