Class: LogStash::Outputs::Seq
- Inherits:
-
Base
- Object
- Base
- LogStash::Outputs::Seq
- Includes:
- PluginMixins::HttpClient
- Defined in:
- lib/logstash/outputs/seq.rb
Overview
An output that sends events to Seq.
Constant Summary collapse
- @@ignore_properties =
{ '@timestamp' => true, '@level' => true, '@version' => true, 'message' => true }
Instance Method Summary collapse
Instance Method Details
#multi_receive(events) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/logstash/outputs/seq.rb', line 49 def multi_receive(events) payload = { 'Events' => events.map {|event| to_seq_payload(event)} } post_to_seq(payload) "#{events.length} events received" end |
#receive(event) ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/logstash/outputs/seq.rb', line 59 def receive(event) payload = { 'Events' => [to_seq_payload(event)] } post_to_seq(payload) 'Event received' end |
#register ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/logstash/outputs/seq.rb', line 29 def register url = @url url += '/' unless url.end_with? '/' url += 'api/events/raw' @url = url @default_headers = { 'X-Seq-ApiKey' => @api_key, 'Content-Type' => 'application/json' } # We count outstanding requests with this queue; it tracks outstanding requests to create backpressure # When this queue is empty no new requests may be sent, tokens must be added back by the client on success @request_tokens = SizedQueue.new(@pool_max) @pool_max.times {|t| @request_tokens << true } end |