logstash-input-file 4.1.12 → 4.1.13

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
  SHA256:
3
- metadata.gz: f7a99266c87fd0a7279a20334fbcf34844bd15bd5602b1011add91f512cd2816
4
- data.tar.gz: 8b913a6f8ccf185dfd0aa325a41f6902c958caf2e496b71c9d5b635d090d383b
3
+ metadata.gz: 256f10c0054f1cabe7fde22c6522dc3c1cf92c169b2584e9e05de977891aab09
4
+ data.tar.gz: 96ff5670352287242b9ec116ee4b4bd5051e5256f00bcdf1ef0ef8fba3115c0b
5
5
  SHA512:
6
- metadata.gz: dd40437784392572ebfd2c0bba20676ae5dfdb3ea3079d706c19e7202c557b55157a614392bd2430b7acee2e875c3ae2d3dd25ac057e2d6e6209c3946a446f8f
7
- data.tar.gz: b37cb04b73602dc63b9931810ee93402bde5f2599f937c4b74824168e3f4692442da6d8da5b29f8928131bae172d5a374fb0f74b2139958624525fe4373833ae
6
+ metadata.gz: ed265f6a90f677a66c6dcd5823d10e043b1be2c9836e1f5001d3ae4485a1f4496bc8ae4d34781ed79cda6778a8362c2e97b34d41161a0ec3248e10ac70b4c77f
7
+ data.tar.gz: b776efe42fb2eadf40b39ce5ba031e4686295b19baaeb20b50608ece46143acd8515e49c65028a5ccb0c0e3732011dcff194f535e4fd9c64b4076f5423a711d9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 4.1.13
2
+ - Fixed sinceDB to work spaces filename [#249](https://github.com/logstash-plugins/logstash-input-file/pull/249)
3
+
1
4
  ## 4.1.12
2
5
  - Fix regression in `exclude` handling. Patterns are matched against the filename, not full path.
3
6
  [Issue #237](https://github.com/logstash-plugins/logstash-input-file/issues/237)
data/README.md CHANGED
@@ -37,6 +37,11 @@ bundle install
37
37
 
38
38
  ```sh
39
39
  bundle install
40
+ ```
41
+
42
+ - Build the jar library used for watching files
43
+ ```bash
44
+ ./gradlew build
40
45
  ```
41
46
 
42
47
  - Run tests
@@ -51,7 +51,7 @@ module FileWatch
51
51
  inode_struct = prepare_inode_struct(parts)
52
52
  pos = parts.shift.to_i
53
53
  expires_at = Float(parts.shift) # this is like Time.now.to_f
54
- path_in_sincedb = parts.shift
54
+ path_in_sincedb = parts.join(" ")
55
55
  value = SincedbValue.new(pos, expires_at).add_path_in_sincedb(path_in_sincedb)
56
56
  [inode_struct, value]
57
57
  end
Binary file
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-file'
4
- s.version = '4.1.12'
4
+ s.version = '4.1.13'
5
5
  s.licenses = ['Apache-2.0']
6
6
  s.summary = "Streams events from files"
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/logstash-plugin install gemname. This gem is not a stand-alone program"
@@ -9,30 +9,55 @@ module FileWatch
9
9
  let(:io) { StringIO.new }
10
10
  let(:db) { Hash.new }
11
11
 
12
- subject { described_class.new(Settings.days_to_seconds(14)) }
12
+ subject { SincedbRecordSerializer.new(Settings.days_to_seconds(14)) }
13
13
 
14
14
  context "deserialize from IO" do
15
15
  it 'reads V1 records' do
16
- io.write("5391299 1 4 12\n")
16
+ io.write("5391297 1 4 12\n")
17
+ io.rewind
18
+ rows = 0
17
19
  subject.deserialize(io) do |inode_struct, sincedb_value|
18
- expect(inode_struct.inode).to eq("5391299")
20
+ expect(inode_struct.inode).to eq("5391297")
19
21
  expect(inode_struct.maj).to eq(1)
20
22
  expect(inode_struct.min).to eq(4)
21
23
  expect(sincedb_value.position).to eq(12)
24
+ rows += 1
22
25
  end
26
+ expect(rows).to be > 0
23
27
  end
24
28
 
25
29
  it 'reads V2 records from an IO object' do
26
30
  now = Time.now.to_f
27
- io.write("5391299 1 4 12 #{now} /a/path/to/1.log\n")
31
+ io.write("5391298 1 4 12 #{now} /a/path/to/1.log\n")
32
+ io.rewind
33
+ rows = 0
28
34
  subject.deserialize(io) do |inode_struct, sincedb_value|
29
- expect(inode_struct.inode).to eq("5391299")
35
+ expect(inode_struct.inode).to eq("5391298")
30
36
  expect(inode_struct.maj).to eq(1)
31
37
  expect(inode_struct.min).to eq(4)
32
38
  expect(sincedb_value.position).to eq(12)
33
39
  expect(sincedb_value.last_changed_at).to eq(now)
34
40
  expect(sincedb_value.path_in_sincedb).to eq("/a/path/to/1.log")
41
+ rows += 1
35
42
  end
43
+ expect(rows).to be > 0
44
+ end
45
+
46
+ it 'properly handles spaces in a filename' do
47
+ now = Time.now.to_f
48
+ io.write("53912987 1 4 12 #{now} /a/path/to/log log.log\n")
49
+ io.rewind
50
+ rows = 0
51
+ subject.deserialize(io) do |inode_struct, sincedb_value|
52
+ expect(inode_struct.inode).to eq("53912987")
53
+ expect(inode_struct.maj).to eq(1)
54
+ expect(inode_struct.min).to eq(4)
55
+ expect(sincedb_value.position).to eq(12)
56
+ expect(sincedb_value.last_changed_at).to eq(now)
57
+ expect(sincedb_value.path_in_sincedb).to eq("/a/path/to/log log.log")
58
+ rows += 1
59
+ end
60
+ expect(rows).to be > 0
36
61
  end
37
62
  end
38
63
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-file
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.12
4
+ version: 4.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-06 00:00:00.000000000 Z
11
+ date: 2020-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement