Can build logstash input are API?


(keep) #1

Can build logstash input are API for waiting log
there are samples?


(Christian Dahlqvist) #2

I am not sure I understand your question. Can you please clarify and provide some additional details?


(keep) #4

Sorry for the question.
I want to use Rest API as input for logstsh


(Christian Dahlqvist) #5

If you want to poll an external rest point for data, have a look at the HTTP poller input plugin to see if it matches your needs.


(keep) #6

@Christian_Dahlqvist HTTP poller input plugin don't meets i needs.

logstash can create rest api of own? for system other use api logstash

Example

Any ideas on how to do this?


(Christian Dahlqvist) #7

Aha, then it may be the http input plugin you are looking for...

If that does not match I suspect you may need to create a custom input plugin.


(keep) #8

@Christian_Dahlqvist I tried to write an http input plugin but could not set the path url and only called localhost only.

Example code
input {
http {
host => "127.0.0.1"
port => "5043"
response_headers => {
"Access-Control-Allow-Methods" => "POST"
"Access-Control-Allow-Origin" => "*"
"Content-Type" => "text/plain"
"Access-Control-Allow-Headers" => "Origin, X-Requested-With, Content-Type, Accept"
}
codec => "json"
}
}
output {
stdout { codec => json { charset => "UTF-8" }}
}


(system) #9

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