fluent-plugin-mesosphere-filter 0.1.8 → 0.1.9

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTdmN2UyMGIwNTY0NjdmNjU1MDk5NjhmNTNlNTg2N2MxMGNkZjg0MQ==
4
+ MDFmNDBiNDczZmY1ZWVkYjMwOWNkNWQ5ZDhmOGIzNWEwYTMwM2E5YQ==
5
5
  data.tar.gz: !binary |-
6
- Y2QxM2MwNzY0NDIzMzEzYzEwNWQ0N2EyMGJkMWMzYzhkMmM1NGMxNQ==
6
+ NTc4ZjBmY2ZhYTI2ODY5Y2ZiZTlmNGY0MTRkNzJmODU5NTdmMjEwZA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZWQyNDZjMmYyMjkwMzcwN2Y4ZGJjODg3MzU1ZjMzNTNmOTgxODZhMGMxYTVm
10
- YzU0ZDlmMzUyMDBkNDFiY2RjZTdlYTA5Nzc5MzBkYzY0YTYxZGM2NjAyNzZi
11
- OTFmYTk2ZWQyN2Y0MDkxNWYxNDNjODJjMjM5ZTE5YjE2ZDUyN2I=
9
+ Nzg4OGEwNjRiMTRlZjhmOGZiMmI3OTgwY2JlMTZkZmUyZTIyY2NjZDRlNDU3
10
+ MGE2ZDVjMjMwOTYxNDY5MjIwZjc1YmFiYjI3NmExNmVjMDg5YmVjMTcyOTkx
11
+ Mjc4NmRhZTlkMzY2ZTE5MDdhOTRmMjcyZDMxZTdkOTI0YzU3Yzg=
12
12
  data.tar.gz: !binary |-
13
- NTNmZWIyYzQxNzE0MDk2YTBkYTNkMDIzYzA3ZTJkMTlhN2U4YWNmZjM2ZDFj
14
- MzE0NTg1MjJiZjFhYmUzZGZlZmI2NTBlNDExOGUyZGVkMTdkZGFjNWJkNzIx
15
- ZmNiNzgyMzczZWFjZGVhMTdkYTkyNjJhZjhiNDc1M2M2ZjdlMmM=
13
+ MWJmYzhiZGY1N2RjZjkwN2I0MDMxMjdkNDQ1ZTY5OGU0ZTZiZmRiMjBiZTIz
14
+ YTFmYjBlNTlmMWYzZmEzYTcyM2FkYmVjMWZkMmI5ZDgwYTk4ZGI1YTNjN2I1
15
+ MmE0NjUyYWY3MzMyMDdmZmRkMGE3MWI2MWY3ODlmY2EwYTQ2MGE=
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |gem|
6
6
  gem.name = 'fluent-plugin-mesosphere-filter'
7
- gem.version = '0.1.8'
7
+ gem.version = '0.1.9'
8
8
  gem.authors = ['Joseph Hughes']
9
9
  gem.email = ['jjhughes57@gmail.com']
10
10
  gem.description = 'Filter plugin to add Mesosphere metadata'
@@ -26,7 +26,6 @@ module Fluent
26
26
  config_param :get_container_id_tag, :bool, default: true
27
27
  config_param :container_id_attr, :string, default: 'container_id'
28
28
 
29
- config_param :timestamp_key, :string, default: '@timestamp'
30
29
  config_param :merge_json_log, :bool, default: true
31
30
  config_param :cronos_task_regex,
32
31
  :string,
@@ -63,23 +62,11 @@ module Fluent
63
62
  container_id =
64
63
  get_container_id_from_record(record) if container_id.empty?
65
64
  next unless container_id
66
- record[@timestamp_key] = generate_time_stamp(time)
67
65
  new_es.add(time, modify_record(record, get_mesos_data(container_id)))
68
66
  end
69
67
  new_es
70
68
  end
71
69
 
72
- # Generates a timestamp that the elasticsearch plugin can understand.
73
- #
74
- # ==== Attributes:
75
- # * +time+ - A time record from the event stream
76
- # ==== Returns:
77
- # * A string with the correct datatime format for the elasticsearch plugin
78
- # to consume
79
- def generate_time_stamp(time)
80
- Time.at(time).utc.strftime('%Y-%m-%dT%H:%M:%S%z')
81
- end
82
-
83
70
  # Injects the meso framework data into the record and also merges
84
71
  # the json log if that configuration is enabled.
85
72
  #
@@ -65,26 +65,6 @@ class AmplifierFilterTest < Test::Unit::TestCase
65
65
  assert_equal task_id, log_entry['mesos_task_id']
66
66
  end
67
67
 
68
- def test_timestamp
69
- setup_marathon_container('foobar123', 'marathon')
70
- time_string = ''
71
- filtered = {}
72
- Timecop.freeze(Time.now) do
73
- d1 = create_driver(CONFIG, 'docker.foobar123')
74
- d1.run do
75
- 1000.times do
76
- d1.filter('log' => 'Hello World 4')
77
- end
78
- end
79
- time_string = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S%z')
80
- filtered = d1.filtered_as_array
81
- end
82
-
83
- log_entry = filtered[0][2]
84
-
85
- assert_equal time_string, log_entry['@timestamp']
86
- end
87
-
88
68
  def test_container_cache
89
69
  setup_marathon_container('foobar123', 'marathon')
90
70
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-mesosphere-filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph Hughes