@@ -163,8 +163,8 @@ def test_writes_to_speficied_index_uppercase
163
163
stub_elastic
164
164
driver . emit ( sample_record )
165
165
driver . run
166
- # Allthough index_name has upper-case characters,
167
- # it should be set as lower-case when sent to elasticsearch.
166
+ # Allthough index_name has upper-case characters,
167
+ # it should be set as lower-case when sent to elasticsearch.
168
168
assert_equal ( 'myindex' , index_cmds . first [ 'index' ] [ '_index' ] )
169
169
end
170
170
@@ -185,7 +185,7 @@ def test_writes_to_target_index_key_logstash
185
185
time = Time . parse Date . today . to_s
186
186
stub_elastic_ping
187
187
stub_elastic
188
- driver . emit ( sample_record . merge ( '@target_index' => 'local-override' ) , time )
188
+ driver . emit ( sample_record . merge ( '@target_index' => 'local-override' ) , time . to_i )
189
189
driver . run
190
190
assert_equal ( 'local-override' , index_cmds . first [ 'index' ] [ '_index' ] )
191
191
end
@@ -196,10 +196,10 @@ def test_writes_to_target_index_key_logstash_uppercase
196
196
time = Time . parse Date . today . to_s
197
197
stub_elastic_ping
198
198
stub_elastic
199
- driver . emit ( sample_record . merge ( '@target_index' => 'Local-Override' ) , time )
199
+ driver . emit ( sample_record . merge ( '@target_index' => 'Local-Override' ) , time . to_i )
200
200
driver . run
201
- # Allthough @target_index has upper-case characters,
202
- # it should be set as lower-case when sent to elasticsearch.
201
+ # Allthough @target_index has upper-case characters,
202
+ # it should be set as lower-case when sent to elasticsearch.
203
203
assert_equal ( 'local-override' , index_cmds . first [ 'index' ] [ '_index' ] )
204
204
end
205
205
@@ -219,7 +219,7 @@ def test_writes_to_target_index_key_fallack_logstash
219
219
logstash_index = "logstash-#{ time . getutc . strftime ( "%Y.%m.%d" ) } "
220
220
stub_elastic_ping
221
221
stub_elastic
222
- driver . emit ( sample_record , time )
222
+ driver . emit ( sample_record , time . to_i )
223
223
driver . run
224
224
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
225
225
end
@@ -373,7 +373,7 @@ def test_writes_to_logstash_index
373
373
logstash_index = "logstash-2015.05.31"
374
374
stub_elastic_ping
375
375
stub_elastic
376
- driver . emit ( sample_record , dt . to_time )
376
+ driver . emit ( sample_record , dt . to_time . to_i )
377
377
driver . run
378
378
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
379
379
end
@@ -387,7 +387,7 @@ def test_writes_to_logstash_non_utc_index
387
387
index = "logstash-#{ time . strftime ( "%Y.%m.%d" ) } "
388
388
stub_elastic_ping
389
389
stub_elastic
390
- driver . emit ( sample_record , time )
390
+ driver . emit ( sample_record , time . to_i )
391
391
driver . run
392
392
assert_equal ( index , index_cmds . first [ 'index' ] [ '_index' ] )
393
393
end
@@ -399,7 +399,7 @@ def test_writes_to_logstash_index_with_specified_prefix
399
399
logstash_index = "myprefix-#{ time . getutc . strftime ( "%Y.%m.%d" ) } "
400
400
stub_elastic_ping
401
401
stub_elastic
402
- driver . emit ( sample_record , time )
402
+ driver . emit ( sample_record , time . to_i )
403
403
driver . run
404
404
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
405
405
end
@@ -411,10 +411,10 @@ def test_writes_to_logstash_index_with_specified_prefix_uppercase
411
411
logstash_index = "myprefix-#{ time . getutc . strftime ( "%Y.%m.%d" ) } "
412
412
stub_elastic_ping
413
413
stub_elastic
414
- driver . emit ( sample_record , time )
414
+ driver . emit ( sample_record , time . to_i )
415
415
driver . run
416
- # Allthough logstash_prefix has upper-case characters,
417
- # it should be set as lower-case when sent to elasticsearch.
416
+ # Allthough logstash_prefix has upper-case characters,
417
+ # it should be set as lower-case when sent to elasticsearch.
418
418
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
419
419
end
420
420
@@ -425,7 +425,7 @@ def test_writes_to_logstash_index_with_specified_dateformat
425
425
logstash_index = "logstash-#{ time . getutc . strftime ( "%Y.%m" ) } "
426
426
stub_elastic_ping
427
427
stub_elastic
428
- driver . emit ( sample_record , time )
428
+ driver . emit ( sample_record , time . to_i )
429
429
driver . run
430
430
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
431
431
end
@@ -438,7 +438,7 @@ def test_writes_to_logstash_index_with_specified_prefix_and_dateformat
438
438
logstash_index = "myprefix-#{ time . getutc . strftime ( "%Y.%m" ) } "
439
439
stub_elastic_ping
440
440
stub_elastic
441
- driver . emit ( sample_record , time )
441
+ driver . emit ( sample_record , time . to_i )
442
442
driver . run
443
443
assert_equal ( logstash_index , index_cmds . first [ 'index' ] [ '_index' ] )
444
444
end
0 commit comments