Logstash http module not sending message

287 views Asked by At

I am trying to make an output POST message with the http module. I have the following config:

http {
        http_method => "post"
        url => "http://localhost:40104/api/message"
        format => "message"
        content_type => "application/json"
        message => "Test"
    }

It calls the API, but the POST has no body. I expect it to contain "Test".

We are using Logstash version 1.5 on Windows.

We tried using as_json after the message, we tried formatting the message as JSON, we tried sending content_type text and we tried a few other things.

Why does it not work and how can it be solved?

1

There are 1 answers

4
kobhqlt On BEST ANSWER

With this configuration I can get the message as raw body :

http {
  http_method => "post"
  url => "http://requestb.in/1mcpwx51"
  format => "message"
  content_type => "text/plain"
  message => "Test"
}

I suggest you could test your output with the http://requestb.in service, it's really useful to see what input your server will get on request.

I hope that helps.