Error with http-plugin output Encountered non-2xx HTTP code 400

Hi,

I am trying to send a notification from Logstash to our Teams channel, using HTTP plugin however I am getting :

[HTTP Output Failure] Encountered non-2xx HTTP code 400 {:response_code=>400

and this is my output configuration:

output {
  # sent  notification from logstash output to Teams channel
  if  [loglevel] == "ERROR" and [message] !~ /Requested number range/ {
    http {
      url => ""
      http_method => "post"
      format => "json"
      content_type => "application/json"
      message => {
        "text" => "Error log detected  Here is the event that triggered this alert"
      }
      proxy => ""
    }

    stdout {
      codec => json_lines
    }
  }

}

Hi @bilal_adoui

I am facing the same issue. Did you manage to fix it ?

Best, B.

Hi,

Try changing your message field to something like this:

message => '{ "text": "Error log detected. Here is the event that triggered this alert." }'

Regards

Unfortunately not yet, seems it's a bug.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.