fluent-plugin-systemd 0.0.6 → 0.0.7

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: b743a85ec91f64910f7c323a6ac9c3ba2f3dc8be
4
- data.tar.gz: df1ca5c2c12b2d46e7d97fc03dc7c8c6fedf388e
3
+ metadata.gz: 52a7137bc995eb3728a32688a3ee7d6ca1dc525a
4
+ data.tar.gz: f4341fe249300532ba5e13eb399261c522ebaeb2
5
5
  SHA512:
6
- metadata.gz: 8c9e624bc2f7ee2d996b28180d7fd9dbf46748b9f3d45dc65b6ad90bbedf57da2b44a72e25db87782f1f02dd00f8f1af14eb1b5a30205cf953ec0e0e8a8ea8e0
7
- data.tar.gz: 624889ccba1c2176c71fd763699cc57470136820f4afa2a8241a61a7fe7586cfebe3d499bf7a65dd531fbfa0d1680b3041802a56c5e501f64087f39ba95a4eae
6
+ metadata.gz: 56296694577ea11491800068cc437089d3846bb30dc60cd9031671e08ca5a8d0a983e9aec42a00db36659b98d68a227d123d97250b79d33b8b75162fc2661343
7
+ data.tar.gz: b5fbccaef86385247778712ed68c319eff8f1f648ac4879dd41f59eba3d4fa4d718bc1e46dea9bef5e923d0a634319a89f52e30c200a44fe9138f799d79bc433
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-systemd (0.0.6)
4
+ fluent-plugin-systemd (0.0.7)
5
5
  fluentd (~> 0.12)
6
6
  systemd-journal (~> 1.2)
7
7
 
data/README.md CHANGED
@@ -26,11 +26,11 @@ if you are using fluentd v0.14 for the latest and greatest features
26
26
 
27
27
  Simply use RubyGems:
28
28
 
29
- gem install fluent-plugin-systemd -v 0.0.6
29
+ gem install fluent-plugin-systemd -v 0.0.7
30
30
 
31
31
  or
32
32
 
33
- td-agent-gem install fluent-plugin-systemd -v 0.0.6
33
+ td-agent-gem install fluent-plugin-systemd -v 0.0.7
34
34
 
35
35
  ## Configuration
36
36
 
data/Vagrantfile ADDED
@@ -0,0 +1,71 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure("2") do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Every Vagrant development environment requires a box. You can search for
14
+ # boxes at https://atlas.hashicorp.com/search.
15
+ config.vm.box = "centos/7"
16
+
17
+ # Disable automatic box update checking. If you disable this, then
18
+ # boxes will only be checked for updates when the user runs
19
+ # `vagrant box outdated`. This is not recommended.
20
+ # config.vm.box_check_update = false
21
+
22
+ # Create a forwarded port mapping which allows access to a specific port
23
+ # within the machine from a port on the host machine. In the example below,
24
+ # accessing "localhost:8080" will access port 80 on the guest machine.
25
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
26
+
27
+ # Create a private network, which allows host-only access to the machine
28
+ # using a specific IP.
29
+ # config.vm.network "private_network", ip: "192.168.33.10"
30
+
31
+ # Create a public network, which generally matched to bridged network.
32
+ # Bridged networks make the machine appear as another physical device on
33
+ # your network.
34
+ # config.vm.network "public_network"
35
+
36
+ # Share an additional folder to the guest VM. The first argument is
37
+ # the path on the host to the actual folder. The second argument is
38
+ # the path on the guest to mount the folder. And the optional third
39
+ # argument is a set of non-required options.
40
+ # config.vm.synced_folder "../data", "/vagrant_data"
41
+
42
+ # Provider-specific configuration so you can fine-tune various
43
+ # backing providers for Vagrant. These expose provider-specific options.
44
+ # Example for VirtualBox:
45
+ #
46
+ # config.vm.provider "virtualbox" do |vb|
47
+ # # Display the VirtualBox GUI when booting the machine
48
+ # vb.gui = true
49
+ #
50
+ # # Customize the amount of memory on the VM:
51
+ # vb.memory = "1024"
52
+ # end
53
+ #
54
+ # View the documentation for the provider you are using for more
55
+ # information on available options.
56
+
57
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58
+ # such as FTP and Heroku are also available. See the documentation at
59
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
60
+ # config.push.define "atlas" do |push|
61
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62
+ # end
63
+
64
+ # Enable provisioning with a shell script. Additional provisioners such as
65
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66
+ # documentation for more information about their specific syntax and use.
67
+ # config.vm.provision "shell", inline: <<-SHELL
68
+ # apt-get update
69
+ # apt-get install -y apache2
70
+ # SHELL
71
+ end
@@ -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.0.6"
8
+ spec.version = "0.0.7"
9
9
  spec.authors = ["Ed Robinson"]
10
10
  spec.email = ["ed@reevoo.com"]
11
11
 
@@ -16,9 +16,6 @@ module Fluent
16
16
  def configure(conf)
17
17
  super
18
18
  @pos_writer = PosWriter.new(@pos_file)
19
- @journal = Systemd::Journal.new(path: @path)
20
- @journal.filter(*@filters)
21
- seek
22
19
  end
23
20
 
24
21
  def start
@@ -37,6 +34,16 @@ module Fluent
37
34
 
38
35
  private
39
36
 
37
+ def init_journal
38
+ sleep 0.25
39
+ @journal = Systemd::Journal.new(path: @path)
40
+ # make sure initial call to wait doesn't return :invalidate
41
+ # see https://github.com/ledbettj/systemd-journal/issues/70
42
+ @journal.wait(0)
43
+ @journal.filter(*@filters)
44
+ seek
45
+ end
46
+
40
47
  def seek
41
48
  seek_to(@pos_writer.cursor || read_from)
42
49
  rescue Systemd::JournalError
@@ -59,6 +66,7 @@ module Fluent
59
66
  end
60
67
 
61
68
  def run
69
+ init_journal
62
70
  Thread.current.abort_on_exception = true
63
71
  watch do |entry|
64
72
  begin
@@ -76,7 +84,7 @@ module Fluent
76
84
 
77
85
  def watch
78
86
  while @running
79
- next unless @journal.wait(1_000_000)
87
+ init_journal if @journal.wait(0) == :invalidate
80
88
  while @journal.move_next && @running
81
89
  yield @journal.current_entry
82
90
  @pos_writer.update(@journal.cursor)
@@ -27,7 +27,6 @@ module Fluent
27
27
  end
28
28
 
29
29
  def update(c)
30
- return unless @path
31
30
  @lock.synchronize { @cursor = c }
32
31
  end
33
32
 
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.0.6
4
+ version: 0.0.7
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-15 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -106,13 +106,19 @@ files:
106
106
  - LICENCE
107
107
  - README.md
108
108
  - Rakefile
109
+ - Vagrantfile
109
110
  - fluent-plugin-systemd.gemspec
110
111
  - lib/fluent/plugin/in_systemd.rb
111
112
  - lib/fluent/plugin/systemd/pos_writer.rb
112
113
  - pkg/fluent-plugin-systemd-0.0.3.gem
113
114
  - pkg/fluent-plugin-systemd-0.0.4.gem
114
115
  - pkg/fluent-plugin-systemd-0.0.5.gem
116
+ - pkg/fluent-plugin-systemd-0.0.6.gem
115
117
  - pkg/fluent-plugin-systemd-0.1.0.gem
118
+ - pkg/fluent-plugin-systemd-0.1.1.gem
119
+ - pkg/fluent-plugin-systemd-0.1.1.pre.gem
120
+ - pkg/fluent-plugin-systemd-0.1.1.pre2.gem
121
+ - pkg/fluent-plugin-systemd-0.1.1.pre3.gem
116
122
  homepage: https://github.com/reevoo/fluent-plugin-systemd
117
123
  licenses:
118
124
  - MIT
@@ -133,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
139
  version: '0'
134
140
  requirements: []
135
141
  rubyforge_project:
136
- rubygems_version: 2.4.5.1
142
+ rubygems_version: 2.6.9
137
143
  signing_key:
138
144
  specification_version: 4
139
145
  summary: Input plugin to read from systemd journal.