How to post the http request with Authorization header , header content type and Body using logstash HTTP poller input plugin?

Hi,
I have to post a request with different attributes of Authorization header , header content type and Body part . can anybody try to help out this.

input {

http_poller {
urls => {
request1 => {
method => "post"
headers => {"Content-Type" => "application/json"}
url => "http://localhost/v3/token"

	 body => '{ 
			       "grant_type" : "password",
				   "username" :"UN1",
				   "password" : "mypass",
				   "scope" :"<scope value>"
			    }'
			  auth => {
                    apikey=> "9xx123456"
                    passwordkey => "paskey"	
               }

            }
			
        }
	}
}

Kindly assist , if you are facing same issue.

The configuration of an input is fixed at startup. If you want to make different http requests at different times perhaps you could use an http filter instead of an input.

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