Class: MtrRec
- Inherits:
-
Object
- Object
- MtrRec
- Defined in:
- lib/logstash/codecs/mtrraw.rb
Overview
This codec presumes you’ve somehow sent in the equivalent of this bash one-liner: (echo “S MYTARGET” ; mtr –raw -c <samplecount> 8.8.8.8) | awk ‘$1“;”’ You can get that into logstash any way you want, e.g. netcat will work if you set up a tcp input: (echo “S MYTARGET” ; mtr –raw -c <samplecount> 8.8.8.8) | awk ‘$1“;”’ | nc <myserver> <myport>
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#id ⇒ Object
Returns the value of attribute id.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(line) ⇒ MtrRec
constructor
A new instance of MtrRec.
Constructor Details
#initialize(line) ⇒ MtrRec
20 21 22 23 24 25 |
# File 'lib/logstash/codecs/mtrraw.rb', line 20 def initialize(line) parts = line.split(/\s+/,3) @type = parts[0] @id = parts[1] @data = parts[2] end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
19 20 21 |
# File 'lib/logstash/codecs/mtrraw.rb', line 19 def data @data end |
#id ⇒ Object
Returns the value of attribute id.
19 20 21 |
# File 'lib/logstash/codecs/mtrraw.rb', line 19 def id @id end |
#type ⇒ Object
Returns the value of attribute type.
19 20 21 |
# File 'lib/logstash/codecs/mtrraw.rb', line 19 def type @type end |