Exception: LogStash::Filters::Grok::TimeoutException

Inherits:
Exception
  • Object
show all
Defined in:
lib/logstash/filters/grok/timeout_exception.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(grok = nil, field = nil, value = nil) ⇒ TimeoutException

Returns a new instance of TimeoutException.



4
5
6
7
8
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 4

def initialize(grok=nil, field=nil, value=nil)
  @field = field
  @value = value
  @grok = grok
end

Instance Attribute Details

#fieldObject (readonly)

Returns the value of attribute field.



2
3
4
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 2

def field
  @field
end

#grokObject (readonly)

Returns the value of attribute grok.



2
3
4
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 2

def grok
  @grok
end

#valueObject (readonly)

Returns the value of attribute value.



2
3
4
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 2

def value
  @value
end

Instance Method Details

#messageObject



10
11
12
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 10

def message
  "Timeout executing grok '#{@grok.pattern}' against field '#{field}' with value '#{trunc_value}'!"
end

#trunc_valueObject



14
15
16
17
18
19
20
# File 'lib/logstash/filters/grok/timeout_exception.rb', line 14

def trunc_value
  if value.size <= 255 # If no more than 255 chars
    value
  else
    "Value too large to output (#{value.bytesize} bytes)! First 255 chars are: #{value[0..255]}"
  end
end