fluent-plugin-script 0.1.1 → 0.2.0

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: a1f9c54f7a77588c697b18bb8a7a436b265ce3d2e66c7b2948bbca68f4d44817
4
- data.tar.gz: 9598ade4d234e9e75c384aada033ecc04c48b4c544db7e7c75461a56838c08fc
3
+ metadata.gz: ae60a7ee2711c90ea3df3e4e8954e22ccc40199218c5cec818ca1f79376069bf
4
+ data.tar.gz: 571c66c0ee9fd719027210848fb43456e919849d711af14d6a2cf4266282772c
5
5
  SHA512:
6
- metadata.gz: 7107192083933e67ef3d5b19e7d63a15f4797c10b0cb394cca1264e4f882288cd5f341ac3d7795ff34550f5a70544c44523f7eca8ed06fb83d91e1a2446e556c
7
- data.tar.gz: 6db2bb18f256864fa4a5d2a770767fb108d85dabdb4bcae7fde0c9f5e418a7c2fbc8bdba8b5425797080cf32d898578430c00b0bf00ea8f867fcf971e59b35c1
6
+ metadata.gz: 4ba801812a9ef752f0d4691f61d293ee8e9596a6535464b8c2903a604809a2804cc3694520f2d804b2551cf4710d2c0c1dda59ecfda5c029782d9f8e68ec9b44
7
+ data.tar.gz: 6818b80ebd632abb31d91374a32b530284db33e984ce5a0cb0bc14126842ffce0f1b4f8c82496f672b331d2f3038f0b86d2113e3ee84f47b81ab4ec04576655c
data/README.md CHANGED
@@ -52,6 +52,21 @@ end
52
52
 
53
53
  ref. http://docs.fluentd.org/articles/plugin-development#filter-plugins
54
54
 
55
+ #### Setting default directory
56
+
57
+ By setting the `FLUENT_PLUGIN_SCRIPT_DIR` environment variable, you can specify the default directory where scripts are located and access them without specifying the full path.
58
+
59
+ ```bash
60
+ FLUENT_PLUGIN_SCRIPT_DIR="/etc/fluentd/"
61
+ ```
62
+
63
+ ```
64
+ <filter foo.bar.*>
65
+ type script
66
+ path example.rb
67
+ </filter>
68
+ ```
69
+
55
70
  ## Example
56
71
 
57
72
  #### example.rb
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "fluent-plugin-script"
3
- s.version = "0.1.1"
3
+ s.version = "0.2.0"
4
4
  s.licenses = ["MIT"]
5
5
  s.summary = "Fluentd filter plugin to external ruby script"
6
6
  s.description = s.summary
@@ -12,6 +12,7 @@ module Fluent::Plugin
12
12
  end
13
13
 
14
14
  def load_script_file(path)
15
+ path = "#{ENV['FLUENT_PLUGIN_SCRIPT_DIR']}/#{path}" if path[0] != '/' && ENV['FLUENT_PLUGIN_SCRIPT_DIR']
15
16
  raise Fluent::ConfigError, "Ruby script file does not exist: #{path}" unless File.exist?(path)
16
17
  eval "self.instance_eval do;" + IO.read(path) + ";\nend"
17
18
  end
@@ -28,6 +28,11 @@ class RubyFilterTest < Test::Unit::TestCase
28
28
  conf = "path #{__dir__}/example.rb"
29
29
  assert_nothing_raised { create_driver(conf) }
30
30
  end
31
+ test 'file exist with FLUENT_PLUGIN_SCRIPT_DIR' do
32
+ ENV['FLUENT_PLUGIN_SCRIPT_DIR'] = __dir__
33
+ conf = 'path example.rb'
34
+ assert_nothing_raised { create_driver(conf) }
35
+ end
31
36
  end
32
37
 
33
38
  sub_test_case 'filter' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-script
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - SNakano
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-23 00:00:00.000000000 Z
11
+ date: 2024-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -80,7 +80,7 @@ homepage: https://github.com/SNakano/fluent-plugin-script
80
80
  licenses:
81
81
  - MIT
82
82
  metadata: {}
83
- post_install_message:
83
+ post_install_message:
84
84
  rdoc_options: []
85
85
  require_paths:
86
86
  - lib
@@ -95,8 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubygems_version: 3.1.2
99
- signing_key:
98
+ rubygems_version: 3.0.3.1
99
+ signing_key:
100
100
  specification_version: 4
101
101
  summary: Fluentd filter plugin to external ruby script
102
102
  test_files: