Class: TaDataDO

Inherits:
Object
  • Object
show all
Defined in:
lib/logstash/filter/sensors/sensors_data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#account_idObject

Returns the value of attribute account_id.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def 
  @account_id
end

#distinct_idObject

Returns the value of attribute distinct_id.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def distinct_id
  @distinct_id
end

#event_idObject

Returns the value of attribute event_id.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def event_id
  @event_id
end

#event_nameObject

Returns the value of attribute event_name.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def event_name
  @event_name
end

#first_check_idObject

Returns the value of attribute first_check_id.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def first_check_id
  @first_check_id
end

#ipObject

Returns the value of attribute ip.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def ip
  @ip
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def properties
  @properties
end

#timeObject

Returns the value of attribute time.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def time
  @time
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def type
  @type
end

#uuidObject

Returns the value of attribute uuid.



6
7
8
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 6

def uuid
  @uuid
end

Instance Method Details

#to_json(*a) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/logstash/filter/sensors/sensors_data.rb', line 8

def to_json(*a)

  json_obj = {
      "#account_id" => @account_id,
      "#distinct_id" => @distinct_id,
      "#uuid" => @uuid,
      "#type" => @type,
      "#time" => @time,
      "#ip" => @ip,
      "#event_name" => @event_name,
      "#event_id" => @event_id,
      "#first_check_id" => @first_check_id,
      "properties" => @properties,
  }
  json_obj.each do |key, value|
    if value.nil? || value == ''
      json_obj.delete(key)
    end
  end
  json_obj.to_json(*a)
end