logstash-filter-rest icon indicating copy to clipboard operation
logstash-filter-rest copied to clipboard

Not able to set right JSON payload in body

Open rkhapre opened this issue 6 years ago • 1 comments

Hi Here how my conf file looks like

rest {
   request => {
     url =>"https://abc.com"       
     method => "post"                  
  headers => {
		"Authorization" => "%{access}"
		"Content-Type" => "application/json"
		}

     params => '{
	"reportRequests" :
	[{
			"checkid" : "2345678",
			"dateRanges" : [{
					"endDate" : "2018-11-12",
					"startDate" : "2018-11-01"
				}
			]
		}
	]
}'
   }
   json => true                         
   target => "my_key"                  

 }

This is the error i am getting

fieldViolations\": [\n {\n \"description\": \"Invalid JSON payload received. Unknown name \\\"\\\": Root element must be a message.\"

The exact body works perfectly in POSTMAN, but here it does not work. Looks like something is missing params/body. Please suggest the right syntax or such feature is not supported?

rkhapre avatar Nov 21 '18 18:11 rkhapre

Hi @lucashenning and @gandalfb , please let me know if this can be achieved with params ?

Thanks!

rkhapre avatar Nov 22 '18 02:11 rkhapre