pysysops-filter-date 2.0.3 → 2.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a945e95fa172248c1620a80648b0434789a1b00
4
- data.tar.gz: c6946268ff371a5b393edb85f58d1d91ecbc4a1b
3
+ metadata.gz: a56a66cbde2faaf48ce3e9eb57911639a2d45cf9
4
+ data.tar.gz: 7f4f211e7559b2d0cb0ca8fca059596e7681d0ec
5
5
  SHA512:
6
- metadata.gz: 56372dd4aa79a9e2c6241a6a79ee74e36e1784adf1268dc28bfcb63b60fad75ecc7d894506e37abb33eacd8890a0928586bfb53814894c1ba91b9c50835b355a
7
- data.tar.gz: 1eb72298f62f0d8c81de21c69e8aa1c8058aa1a9f5b3c6d6d621602251f3cc74a4f7948d82963628bf19224dc6544a34d5d426424745dcf7112bb647684277a6
6
+ metadata.gz: 4bf04292d2195f0e5077eb21952d9681f349d5e79f4857aca87b9d2f4f2755b0b56dcea4889037679ba35c1b2704ae30178e2548480e908f69c7d3ce50d02bc7
7
+ data.tar.gz: c75339d128b3caf87e72a1eb4d0cd17ae95dfc5496e9720f4e3bc109f6a10826b695709a0c7d94d52d352250dd61b9f7410b2f5b94859ea8405b94df6100c591
@@ -69,7 +69,7 @@ class LogStash::Filters::Date < LogStash::Filters::Base
69
69
  # * `ISO8601` - should parse any valid ISO8601 timestamp, such as
70
70
  # `2011-04-19T03:44:01.103Z`
71
71
  # * `UNIX` - will parse *float or int* value expressing unix time in seconds since epoch like 1326149001.132 as well as 1326149001
72
- # * `UNIX_MS` - will parse **int** value expressing unix time in milliseconds since epoch like 1366125117000
72
+ # * `UNIX_MS` - will parse **int** value expressing unix time in milliseconds since epoch like 1366125117000. THis format can also be used for timestamps in units of time such as micro or nanoseconds. However, the resulting time will be to millisecond accuracy. Note: timestamp values of 13 digits or less in length will be handled as a millisecond timestamp.
73
73
  # * `TAI64N` - will parse tai64n time values
74
74
  #
75
75
  # For example, if you have a field `logdate`, with a value that looks like
@@ -161,12 +161,7 @@ class LogStash::Filters::Date < LogStash::Filters::Base
161
161
  when "UNIX_MS" # unix epoch in ms
162
162
  parsers << lambda do |date|
163
163
  raise "Invalid UNIX epoch value '#{date}'" unless /^\d+$/ === date || date.is_a?(Numeric)
164
- date.to_i
165
- end
166
- when "UNIX_NANO" # unix epoch in nanoseconds
167
- parsers << lambda do |date|
168
- raise "Invalid UNIX epoch value '#{date}'" unless /^\d+$/ === date || date.is_a?(Numeric)
169
- (date.to_i / 1000000).to_i
164
+ date.to_s.slice(0..12).to_i
170
165
  end
171
166
  when "TAI64N" # TAI64 with nanoseconds, -10000 accounts for leap seconds
172
167
  parsers << lambda do |date|
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'pysysops-filter-date'
4
- s.version = '2.0.3'
4
+ s.version = '2.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "The date filter is used for parsing dates from fields, and then using that date or timestamp as the logstash timestamp for the event."
7
7
  s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
@@ -175,40 +175,12 @@ RUBY_ENGINE == "jruby" and describe LogStash::Filters::Date do
175
175
  "0" => "1970-01-01T00:00:00.000Z",
176
176
  "456" => "1970-01-01T00:00:00.456Z",
177
177
  "1000000000123" => "2001-09-09T01:46:40.123Z",
178
-
179
- # LOGSTASH-279 - sometimes the field is a number.
180
- 0 => "1970-01-01T00:00:00.000Z",
181
- 456 => "1970-01-01T00:00:00.456Z",
182
- 1000000000123 => "2001-09-09T01:46:40.123Z"
183
- }
184
- times.each do |input, output|
185
- sample("mydate" => input) do
186
- insist { subject["mydate"] } == input
187
- insist { subject["@timestamp"].time } == Time.iso8601(output)
188
- end
189
- end # times.each
190
- end
191
-
192
- describe "parsing with UNIX_NANO" do
193
- config <<-CONFIG
194
- filter {
195
- date {
196
- match => [ "mydate", "UNIX_NANO" ]
197
- locale => "en"
198
- }
199
- }
200
- CONFIG
201
-
202
- times = {
203
- "0" => "1970-01-01T00:00:00.000Z",
204
- "4569999" => "1970-01-01T00:00:00.004Z",
205
- "456999936" => "1970-01-01T00:00:00.456Z",
206
178
  "1000000000123999936" => "2001-09-09T01:46:40.123Z",
207
179
 
208
180
  # LOGSTASH-279 - sometimes the field is a number.
209
181
  0 => "1970-01-01T00:00:00.000Z",
210
- 4569999 => "1970-01-01T00:00:00.004Z",
211
- 456999936 => "1970-01-01T00:00:00.456Z",
182
+ 456 => "1970-01-01T00:00:00.456Z",
183
+ 1000000000123 => "2001-09-09T01:46:40.123Z",
212
184
  1000000000123999936 => "2001-09-09T01:46:40.123Z"
213
185
  }
214
186
  times.each do |input, output|
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pysysops-filter-date
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2015-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: logstash-core
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '>='
@@ -19,9 +20,8 @@ dependencies:
19
20
  - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 3.0.0
22
- name: logstash-core
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '>='
@@ -31,83 +31,85 @@ dependencies:
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.0.0
33
33
  - !ruby/object:Gem::Dependency
34
+ name: logstash-input-generator
34
35
  requirement: !ruby/object:Gem::Requirement
35
36
  requirements:
36
37
  - - '>='
37
38
  - !ruby/object:Gem::Version
38
39
  version: '0'
39
- name: logstash-input-generator
40
- prerelease: false
41
40
  type: :runtime
41
+ prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
+ name: logstash-codec-json
48
49
  requirement: !ruby/object:Gem::Requirement
49
50
  requirements:
50
51
  - - '>='
51
52
  - !ruby/object:Gem::Version
52
53
  version: '0'
53
- name: logstash-codec-json
54
- prerelease: false
55
54
  type: :runtime
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - '>='
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
+ name: logstash-output-null
62
63
  requirement: !ruby/object:Gem::Requirement
63
64
  requirements:
64
65
  - - '>='
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
- name: logstash-output-null
68
- prerelease: false
69
68
  type: :runtime
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
+ name: logstash-devutils
76
77
  requirement: !ruby/object:Gem::Requirement
77
78
  requirements:
78
79
  - - '>='
79
80
  - !ruby/object:Gem::Version
80
81
  version: '0'
81
- name: logstash-devutils
82
- prerelease: false
83
82
  type: :development
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: '0'
89
- description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
89
+ description: This gem is a logstash plugin required to be installed on top of the
90
+ Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not
91
+ a stand-alone program
90
92
  email: info@elastic.co
91
93
  executables: []
92
94
  extensions: []
93
95
  extra_rdoc_files: []
94
96
  files:
97
+ - lib/logstash/filters/date.rb
98
+ - spec/filters/date_spec.rb
99
+ - logstash-filter-date.gemspec
95
100
  - CHANGELOG.md
101
+ - README.md
96
102
  - CONTRIBUTORS
97
103
  - Gemfile
98
104
  - LICENSE
99
105
  - NOTICE.TXT
100
- - README.md
101
- - lib/logstash/filters/date.rb
102
- - logstash-filter-date.gemspec
103
- - spec/filters/date_spec.rb
104
106
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
105
107
  licenses:
106
108
  - Apache License (2.0)
107
109
  metadata:
108
110
  logstash_plugin: 'true'
109
111
  logstash_group: filter
110
- post_install_message:
112
+ post_install_message:
111
113
  rdoc_options: []
112
114
  require_paths:
113
115
  - lib
@@ -122,10 +124,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
122
124
  - !ruby/object:Gem::Version
123
125
  version: '0'
124
126
  requirements: []
125
- rubyforge_project:
126
- rubygems_version: 2.4.5
127
- signing_key:
127
+ rubyforge_project:
128
+ rubygems_version: 2.0.14
129
+ signing_key:
128
130
  specification_version: 4
129
- summary: The date filter is used for parsing dates from fields, and then using that date or timestamp as the logstash timestamp for the event.
131
+ summary: The date filter is used for parsing dates from fields, and then using that
132
+ date or timestamp as the logstash timestamp for the event.
130
133
  test_files:
131
134
  - spec/filters/date_spec.rb