Class: DatadogAPIClient::V2::HTTPLogItem

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v2/models/http_log_item.rb

Overview

Logs that are sent over HTTP.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ HTTPLogItem

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    attributes Model attributes in the form of hash



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 80

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::HTTPLogItem` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::HTTPLogItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'ddsource')
    self.ddsource = attributes[:'ddsource']
  end

  if attributes.key?(:'ddtags')
    self.ddtags = attributes[:'ddtags']
  end

  if attributes.key?(:'hostname')
    self.hostname = attributes[:'hostname']
  end

  if attributes.key?(:'message')
    self.message = attributes[:'message']
  end

  if attributes.key?(:'service')
    self.service = attributes[:'service']
  end
end

Instance Attribute Details

#ddsourceObject

The integration name associated with your log: the technology from which the log originated. When it matches an integration name, Datadog automatically installs the corresponding parsers and facets. See [reserved attributes](docs.datadoghq.com/logs/log_collection/#reserved-attributes).



27
28
29
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 27

def ddsource
  @ddsource
end

#ddtagsObject

Tags associated with your logs.



30
31
32
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 30

def ddtags
  @ddtags
end

#hostnameObject

The name of the originating host of the log.



33
34
35
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 33

def hostname
  @hostname
end

#messageObject

The message [reserved attribute](docs.datadoghq.com/logs/log_collection/#reserved-attributes) of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry. That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.



36
37
38
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 36

def message
  @message
end

#serviceObject

The name of the application or service generating the log events. It is used to switch from Logs to APM, so make sure you define the same value when you use both products. See [reserved attributes](docs.datadoghq.com/logs/log_collection/#reserved-attributes).



39
40
41
# File 'lib/datadog_api_client/v2/models/http_log_item.rb', line 39

def service
  @service
end