elastic / logstash

Logstash - transport and process your logs, events, or other data
https://www.elastic.co/products/logstash
Other
79 stars 3.5k forks source link

Output plugin: Server-Sent Events (SSE) #3709

Open mattes opened 9 years ago

mattes commented 9 years ago

Is there an output plugin that facilitates Server-Sent Events (SSE) already?

purbon commented 9 years ago

Hi, there is not, that i'm aware of, but probably a good addition to the already available ones.

On Sat, 8 Aug 2015 08:02 Matthias Kadenbach notifications@github.com wrote:

Is there an output plugin that facilitates Server-Sent Events (SSE) http://www.html5rocks.com/en/tutorials/eventsource/basics/ already?

— Reply to this email directly or view it on GitHub https://github.com/elastic/logstash/issues/3709.

mattes commented 9 years ago

Would we buffer events in the plugin and wait until a Browser connects via SSE to fetch the events?

purbon commented 9 years ago

Hi, I'm not sure I understand what you mean, could you explain in more detail?

/cheerd

On Thu, 13 Aug 2015 21:23 Matthias Kadenbach notifications@github.com wrote:

Would we buffer events in the plugin and wait until a Browser connects via SSE to fetch the events?

— Reply to this email directly or view it on GitHub https://github.com/elastic/logstash/issues/3709#issuecomment-130810896.

colinsurprenant commented 9 years ago

@mattes good question! if we don't buffer, then back pressure will be applied after the 20th event (internal queues are 20 elements). I am guessing we could make that configurable and either simply immediately discard events if there is no client connected, or buffer some, up to a limit and discard...

purbon commented 9 years ago

If you want to buffer events, you could try Stud::Buffer [1] the same way as the elasticsearch output does [2].

/cheers

[1] https://github.com/jordansissel/ruby-stud/blob/master/lib/stud/buffer.rb [2] https://github.com/logstash-plugins/logstash-output-elasticsearch/blob/master/lib/logstash/outputs/elasticsearch.rb#L67