fluent-plugin-systemd 0.1.0 → 0.1.1.pre

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: 027149ee076af73b625bdf8dcd22dd25a7f0e833
4
- data.tar.gz: b729df398f867f111fd1a3f188eb7298437195c4
3
+ metadata.gz: dafe014b146104c1af4feffe4db1cfd947bccd54
4
+ data.tar.gz: 282c7fd29f321d4d7f177fcbf8a2bea2e25e29fd
5
5
  SHA512:
6
- metadata.gz: 979f117f454ba7a4d72ce0c62fa82fa5cae5c18be170443a4d77160c2b6f58b2f2c7de8032d6abda96b4070ef83bdb6bf94bd6746277b56984550af1157821ff
7
- data.tar.gz: 8cbcef9a6b30dee72ee515140ede68aa7317d3c9b8d338bdb76c84897d5eae0030ba810f4b840e8d902b8aab9573d58cb81314d2e5eb5b2d71eff9b4da894a60
6
+ metadata.gz: 8c2827d2fdd7baf638ece90a85acb1311517711df37f29bf2c40624ccb324692c8394d8bee9989793d0bdb5b3f9775f10e0fd0a754c407c95dd8fd38cfb91337
7
+ data.tar.gz: e30bce45b8558c03f3143508ba8112c4866fa58f57a4836d9b36ee65cccc6c5be7bb5028de29c7a59bf8933f87008fb60c76e4c73d39cd1175597b4dcf81a3c4
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-systemd (0.1.0)
4
+ fluent-plugin-systemd (0.1.1.pre)
5
5
  fluentd (>= 0.14.11, < 2)
6
6
  systemd-journal (~> 1.2)
7
7
 
@@ -12,7 +12,7 @@ GEM
12
12
  astrolabe (1.3.1)
13
13
  parser (~> 2.2)
14
14
  cool.io (1.4.5)
15
- ffi (1.9.14)
15
+ ffi (1.9.17)
16
16
  fluentd (0.14.11)
17
17
  cool.io (~> 1.4.5)
18
18
  http_parser.rb (>= 0.5.1, < 0.7.0)
@@ -29,7 +29,7 @@ GEM
29
29
  ast (~> 2.2)
30
30
  powerpack (0.0.9)
31
31
  rainbow (2.2.1)
32
- rake (10.5.0)
32
+ rake (12.0.0)
33
33
  reevoocop (0.0.9)
34
34
  rubocop (= 0.28.0)
35
35
  rubocop (0.28.0)
data/README.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/reevoo/fluent-plugin-systemd.svg?branch=master)](https://travis-ci.org/reevoo/fluent-plugin-systemd) [![Code Climate GPA](https://codeclimate.com/github/reevoo/fluent-plugin-systemd/badges/gpa.svg)](https://codeclimate.com/github/reevoo/fluent-plugin-systemd) [![Gem Version](https://badge.fury.io/rb/fluent-plugin-systemd.svg)](https://rubygems.org/gems/fluent-plugin-systemd)
4
4
 
5
+ # Requirements <a name="requirements"></a>
6
+
7
+
8
+ |fluent-plugin-systemd|fluentd|ruby|
9
+ |----|----|----|
10
+ | 0.1.x | >= 0.14.11, < 2 | >= 2.1 |
11
+ | 0.0.x | ~> 0.12.0 | >= 1.9 |
12
+
13
+ * The 0.1.x series is developed from this branch (master)
14
+ * The 0.0.x series (compatible with fluentd v0.12) is developed on the [0.0.x branch](https://github.com/reevoo/fluent-plugin-systemd/tree/0.0.x)
15
+
5
16
  ## Overview
6
17
 
7
18
  **systemd** input plugin reads logs from the systemd journal
@@ -14,11 +25,7 @@ Simply use RubyGems:
14
25
 
15
26
  or
16
27
 
17
- fluent-gem install fluent-plugin-systemd -v 0.1.0
18
-
19
- or
20
-
21
- td-agent-gem install fluent-plugin-systemd -v 0.1.0
28
+ td-agent-gem install fluent-plugin-systemd -v 0.6.0
22
29
 
23
30
  ## Configuration
24
31
 
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "fluent-plugin-systemd"
8
- spec.version = "0.1.0"
8
+ spec.version = "0.1.1.pre"
9
9
  spec.authors = ["Ed Robinson"]
10
10
  spec.email = ["ed@reevoo.com"]
11
11
 
@@ -19,9 +19,6 @@ module Fluent
19
19
  def configure(conf)
20
20
  super
21
21
  @pos_writer = PosWriter.new(@pos_file)
22
- @journal = Systemd::Journal.new(path: @path)
23
- @journal.filter(*@filters)
24
- seek
25
22
  end
26
23
 
27
24
  def start
@@ -37,6 +34,12 @@ module Fluent
37
34
 
38
35
  private
39
36
 
37
+ def init_journal
38
+ @journal = Systemd::Journal.new(path: @path)
39
+ @journal.filter(*@filters)
40
+ seek
41
+ end
42
+
40
43
  def seek
41
44
  seek_to(@pos_writer.cursor || read_from)
42
45
  rescue Systemd::JournalError
@@ -59,6 +62,7 @@ module Fluent
59
62
  end
60
63
 
61
64
  def run
65
+ init_journal
62
66
  Thread.current.abort_on_exception = true
63
67
  watch do |entry|
64
68
  begin
@@ -67,6 +71,7 @@ module Fluent
67
71
  log.error("Exception emitting record: #{e}")
68
72
  end
69
73
  end
74
+ @pos_writer.sync
70
75
  end
71
76
 
72
77
  def formatted(entry)
@@ -27,6 +27,10 @@ module Fluent
27
27
  write_pos
28
28
  end
29
29
 
30
+ def sync
31
+ write_pos
32
+ end
33
+
30
34
  def update(c)
31
35
  return unless @path
32
36
  @lock.synchronize { @cursor = c }
@@ -49,7 +53,7 @@ module Fluent
49
53
  def write_pos
50
54
  @lock.synchronize do
51
55
  if @written_cursor != @cursor
52
- file = File.open(@path, "w+")
56
+ file = File.open(@path, "w+", 0644)
53
57
  file.print @cursor
54
58
  file.close
55
59
  @written_cursor = @cursor
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-systemd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Robinson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-12 00:00:00.000000000 Z
11
+ date: 2017-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,6 +118,8 @@ files:
118
118
  - pkg/fluent-plugin-systemd-0.0.3.gem
119
119
  - pkg/fluent-plugin-systemd-0.0.4.gem
120
120
  - pkg/fluent-plugin-systemd-0.0.5.gem
121
+ - pkg/fluent-plugin-systemd-0.0.6.gem
122
+ - pkg/fluent-plugin-systemd-0.1.0.gem
121
123
  homepage: https://github.com/reevoo/fluent-plugin-systemd
122
124
  licenses:
123
125
  - MIT
@@ -133,12 +135,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
135
  version: '0'
134
136
  required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  requirements:
136
- - - ">="
138
+ - - ">"
137
139
  - !ruby/object:Gem::Version
138
- version: '0'
140
+ version: 1.3.1
139
141
  requirements: []
140
142
  rubyforge_project:
141
- rubygems_version: 2.4.5.1
143
+ rubygems_version: 2.6.9
142
144
  signing_key:
143
145
  specification_version: 4
144
146
  summary: Input plugin to read from systemd journal.