fluent-plugin-datadog-np 0.10.6.2 → 0.10.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b60a22b10a9a2c5302701b8e08d76b4af82be803
4
- data.tar.gz: e7425002c592242f1b14270cbdfeb3ba3eb0195f
3
+ metadata.gz: ff5553e47eda6aa14ce16d939eef66e20ef4c1aa
4
+ data.tar.gz: 3b29129b80804c4fb0ac304659e4d8f265b0a347
5
5
  SHA512:
6
- metadata.gz: 9c0169f75525eb8525302fe8a2a92c8a2b0ed7f2ac17df1a5983dab9cb850796ba9ed031083cc92166256685607ae4a436c794c58516db1efe62153eff245968
7
- data.tar.gz: 4ef05ae7a7bf0d7742faf312d36fdb1f2becb9f41f405aed5e6614679b44facfeae7254f88d57ecd35a0f77ed88e0dfa09e80bf2acd71e42435f4ce211acd59a
6
+ metadata.gz: c7e3c6b5347a394cafee96c6e1b42a15fc0ef1dd94d55f655edd5ddddf7a78b63f70f11f3c3781f7ed3ec14e9845387eb7564e9472d3c3b6cec8ef45fc706b33
7
+ data.tar.gz: bf455fe43aa269e43aa306e59526ac8dced5bdf33e2f32cee1c38cfc15fdf5deca3b30ffd1656cef0cf376cdbf92fb884666b89c6d23435523cc6a27c50c7bba
@@ -9,7 +9,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
9
9
 
10
10
  Gem::Specification.new do |spec|
11
11
  spec.name = "fluent-plugin-datadog-np"
12
- spec.version = "0.10.6.2"
12
+ spec.version = "0.10.6.3"
13
13
  spec.authors = ["Nicolas parfait"]
14
14
  spec.email = [""]
15
15
  spec.summary = "Datadog output plugin for Fluent event collector"
@@ -222,9 +222,21 @@ class Fluent::DatadogOutput < Fluent::BufferedOutput
222
222
  def get_attribute_tags(record, attribute_tags)
223
223
  if not attribute_tags.nil? and not record.nil?
224
224
  tags = Array.new
225
+ # attributes are separated by ,
225
226
  for attribute_tag in attribute_tags.split(",")
226
- log.trace "attribute tags - datadog plugin: attr=#{attribute_tag}, value=#{record[attribute_tag]}"
227
- tags.push(attribute_tag + ":" + record[attribute_tag]) unless record[attribute_tag].nil?
227
+ keyattr = attribute_tag.split(":")
228
+ # tag name is before :
229
+ key = keyattr.at(0)
230
+ # attribute name is after :
231
+ attr = keyattr.at(1)
232
+
233
+ # split attribute name by .
234
+ subrecord = record
235
+ attrparts = attr.split(".")
236
+ for index in (0...attrparts.length - 1)
237
+ subrecord = subrecord[attrparts[index]] unless subrecord[attrparts[index]].nil?
238
+ end
239
+ tags.push(key + ":" + subrecord[attrparts.at(attrparts.length - 1)]) unless subrecord[attrparts.at(attrparts.length - 1)].nil?
228
240
  end
229
241
  return tags.join(",")
230
242
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-datadog-np
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.6.2
4
+ version: 0.10.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas parfait