SOAP request with logstash

Hi,

I'd need to recibe a Soap response from a web service. I coudn't find an oficial documentation and I don't now how to do that with the http poller input from logstash.
Somebody nows how to do this?

Thanks.

The http_poller documentation has an example. What have you tried, and what do you not like about the result?

This is what I've tried.

input {
http_poller {
urls => {
testVersion => {
method => post
url => "http://xxx.xxx.xx.xx/wsservice/service.asmx"

headers => {
"Content-Type" => "text/xml; charset=utf-8"
"SOAPAction" => "http://www.ruronline.com/actualstate"
}

body => {
<x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:www="http://www.rtsolutionsonline.com">
<x:Header/>
<x:Body>
www:EstadoActualCruces
www:party3_keyRN495720-974e-11e9-89b2-0a094ac228f2</www:party3_key>
</www:EstadoActualCruces>
</x:Body>
</x:Envelope>

}

}
}
request_timeout => 30
schedule => @every 30s
codec => "json"
metadata_target => "http_poller_metadata"
}
}

output {
elasticsearch {
.............
}
stdout { codec => rubydebug }

}

I got a general error with the http poller.

What error message did you get?

[2019-07-09T19:37:18,652][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, -, ", ', } at line 38, column 1 (byte 827) after input {\n\thttp_poller {\n\t\turls => {\n\t\ttestVersion => {\n\t\t\tmethod => post\n\t\t\turl => "http://192.168.20.4/ServicioWebCentral/RTServicioCentral.asmx\"\n\n\t\theaders => {\n\t\t\t"Content-Type" => "text/xml; charset=utf-8"\n\t\t\t"SOAPAction" => "http://www.rtsolutionsonline.com/EstadoActualCruces\"\n\t}\nbody => {\n", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in block in compile_sources'", "org/jruby/RubyArray.java:2486:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:22:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:90:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:42:in block in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:92:in block in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in synchronize'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:92:in exclusive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:38:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:317:in block in converge_state'"]}

the output is like this

output {
	 elasticsearch {
	 ssl => true
     ssl_certificate_verification => false
	 hosts => ["https://xx.xx.xx.xx:9200"] 
     index => "status"
	 document_type => "doc"
	 user => "user"
    password => "password"
	 }
	    stdout { codec => rubydebug }

}

An http_poller input does not have an option to specify the body of the request. If you need to specify a body you can use an http filter. Use an exec input running /bin/true every 30 seconds to create a dummy event that the filter can add to.

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