fluent-plugin-elasticsearch 4.1.1 → 5.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  3. data/.github/ISSUE_TEMPLATE/feature_request.md +24 -0
  4. data/.github/dependabot.yml +6 -0
  5. data/.github/workflows/issue-auto-closer.yml +2 -2
  6. data/.github/workflows/linux.yml +5 -2
  7. data/.github/workflows/macos.yml +5 -2
  8. data/.github/workflows/windows.yml +5 -2
  9. data/Gemfile +1 -2
  10. data/History.md +146 -0
  11. data/README.ElasticsearchGenID.md +4 -4
  12. data/README.ElasticsearchInput.md +1 -1
  13. data/README.Troubleshooting.md +692 -0
  14. data/README.md +260 -550
  15. data/fluent-plugin-elasticsearch.gemspec +4 -1
  16. data/lib/fluent/plugin/elasticsearch_compat.rb +31 -0
  17. data/lib/fluent/plugin/elasticsearch_error_handler.rb +19 -4
  18. data/lib/fluent/plugin/elasticsearch_fallback_selector.rb +2 -2
  19. data/lib/fluent/plugin/elasticsearch_index_lifecycle_management.rb +18 -4
  20. data/lib/fluent/plugin/elasticsearch_index_template.rb +65 -21
  21. data/lib/fluent/plugin/elasticsearch_simple_sniffer.rb +2 -1
  22. data/lib/fluent/plugin/filter_elasticsearch_genid.rb +1 -1
  23. data/lib/fluent/plugin/in_elasticsearch.rb +8 -2
  24. data/lib/fluent/plugin/oj_serializer.rb +2 -1
  25. data/lib/fluent/plugin/out_elasticsearch.rb +192 -36
  26. data/lib/fluent/plugin/out_elasticsearch_data_stream.rb +298 -0
  27. data/lib/fluent/plugin/out_elasticsearch_dynamic.rb +3 -1
  28. data/test/helper.rb +0 -4
  29. data/test/plugin/mock_chunk.dat +0 -0
  30. data/test/plugin/test_elasticsearch_error_handler.rb +130 -23
  31. data/test/plugin/test_elasticsearch_fallback_selector.rb +17 -8
  32. data/test/plugin/test_elasticsearch_index_lifecycle_management.rb +57 -18
  33. data/test/plugin/test_elasticsearch_tls.rb +8 -2
  34. data/test/plugin/test_filter_elasticsearch_genid.rb +16 -16
  35. data/test/plugin/test_in_elasticsearch.rb +51 -21
  36. data/test/plugin/test_index_alias_template.json +11 -0
  37. data/test/plugin/test_index_template.json +25 -0
  38. data/test/plugin/test_out_elasticsearch.rb +2118 -704
  39. data/test/plugin/test_out_elasticsearch_data_stream.rb +1199 -0
  40. data/test/plugin/test_out_elasticsearch_dynamic.rb +170 -31
  41. metadata +62 -10
  42. data/.coveralls.yml +0 -2
  43. data/.travis.yml +0 -44
  44. data/appveyor.yml +0 -20
  45. data/gemfiles/Gemfile.without.ilm +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 616365bcf32cc6d302718907d145639cbb4786b33cb8a837da24f3934cf7a837
4
- data.tar.gz: 77df51b64aa07d12b57b82a093f4a5b8cbd1c1bf9c5c82384163118c050c68cf
3
+ metadata.gz: 542a7706becd1b24f8d3e6ad8957015dba5f721b3a93047ec4bea80313df8200
4
+ data.tar.gz: 8104645d96578abf0f4357a22c83a7f9cbc548e7bbc35ef5eeb8726deaada6f8
5
5
  SHA512:
6
- metadata.gz: ae68cc2f0a2abbf7cf7a4c11a9bb5dac9a9e09ba9c053109748c671acd304198b45ad949782691a28eadb418e15bc66f1ef16897f810c5f0b5dd0ce04dd7913e
7
- data.tar.gz: 484df0670840045d6c55bd1971142cf13a2a0c35cefc0ff96ada3259404d08529d97adbdd736bf9eaf99ad84c51d2124af1d0160c35042a736c875eef8aa5f3c
6
+ metadata.gz: 93a2a932a766170b197f3ded762c89912f743cec3ddcef3e7719d8ca57b504f6f7b51bc17bac02ef5073fd1fade3366140a7d775351c8b86b1f05693a76be122
7
+ data.tar.gz: 35b82c172909a1f47dc74507c7ea9df451576b9cb1c8dcba85fdb094b3568b2187aafa1aecbd3367ef2ab0a347a30f90d8b663780e3261bdefc5dcb2b24f0133
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Create a report to help us improve. If you have questions about ES plugin on kubernetes, please direct these to https://discuss.kubernetes.io/ before sumbit kubernetes related issue.
4
+
5
+ ---
6
+
7
+ (check apply)
8
+ - [ ] read [the contribution guideline](https://github.com/uken/fluent-plugin-elasticsearch/blob/master/CONTRIBUTING.md)
9
+ - [ ] (optional) already reported 3rd party upstream repository or mailing list if you use k8s addon or helm charts.
10
+
11
+ #### Problem
12
+
13
+ ...
14
+
15
+ #### Steps to replicate
16
+
17
+ Either clone and modify https://gist.github.com/pitr/9a518e840db58f435911
18
+
19
+ **OR**
20
+
21
+ Provide example config and message
22
+
23
+ #### Expected Behavior or What you need to ask
24
+
25
+ ...
26
+
27
+ #### Using Fluentd and ES plugin versions
28
+
29
+ * OS version
30
+ * Bare Metal or within Docker or Kubernetes or others?
31
+ * Fluentd v0.12 or v0.14/v1.0
32
+ * paste result of ``fluentd --version`` or ``td-agent --version``
33
+ * ES plugin 3.x.y/2.x.y or 1.x.y
34
+ * paste boot log of fluentd or td-agent
35
+ * paste result of ``fluent-gem list``, ``td-agent-gem list`` or your Gemfile.lock
36
+ * ES version (optional)
37
+ * ES template(s) (optional)
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+
5
+ ---
6
+
7
+ (check apply)
8
+ - [ ] read [the contribution guideline](https://github.com/uken/fluent-plugin-elasticsearch/blob/master/CONTRIBUTING.md)
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+
12
+ <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
13
+
14
+ **Describe the solution you'd like**
15
+
16
+ <!-- A clear and concise description of what you want to happen. -->
17
+
18
+ **Describe alternatives you've considered**
19
+
20
+ <!-- A clear and concise description of any alternative solutions or features you've considered. -->
21
+
22
+ **Additional context**
23
+
24
+ <!-- Add any other context or screenshots about the feature request here. -->
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -5,8 +5,8 @@ jobs:
5
5
  runs-on: ubuntu-latest
6
6
  steps:
7
7
  - name: Autoclose issues that did not follow issue template
8
- uses: roots/issue-closer-action@v1.1
8
+ uses: roots/issue-closer-action@v1.2
9
9
  with:
10
10
  repo-token: ${{ secrets.GITHUB_TOKEN }}
11
11
  issue-close-message: "@${issue.user.login} this issue was automatically closed because it did not follow the issue template."
12
- issue-pattern: "(.*Problem.*)|(.*Expected Behavior or What you need to ask.*)|(.*Using Fluentd and ES plugin versions.*)"
12
+ issue-pattern: "(.*Problem.*)|(.*Expected Behavior or What you need to ask.*)|(.*Using Fluentd and ES plugin versions.*)|(.*Is your feature request related to a problem? Please describe.*)|(.*Describe the solution you'd like.*)|(.*Describe alternatives you've considered.*)"
@@ -2,18 +2,21 @@ name: Testing on Ubuntu
2
2
  on:
3
3
  - push
4
4
  - pull_request
5
+ permissions:
6
+ contents: read
7
+
5
8
  jobs:
6
9
  build:
7
10
  runs-on: ${{ matrix.os }}
8
11
  strategy:
9
12
  fail-fast: false
10
13
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6' ]
14
+ ruby: [ '3.0', '3.1', '3.2' ]
12
15
  os:
13
16
  - ubuntu-latest
14
17
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
15
18
  steps:
16
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
17
20
  - uses: ruby/setup-ruby@v1
18
21
  with:
19
22
  ruby-version: ${{ matrix.ruby }}
@@ -2,18 +2,21 @@ name: Testing on macOS
2
2
  on:
3
3
  - push
4
4
  - pull_request
5
+ permissions:
6
+ contents: read
7
+
5
8
  jobs:
6
9
  build:
7
10
  runs-on: ${{ matrix.os }}
8
11
  strategy:
9
12
  fail-fast: false
10
13
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6' ]
14
+ ruby: [ '3.0', '3.1', '3.2' ]
12
15
  os:
13
16
  - macOS-latest
14
17
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
15
18
  steps:
16
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
17
20
  - uses: ruby/setup-ruby@v1
18
21
  with:
19
22
  ruby-version: ${{ matrix.ruby }}
@@ -2,18 +2,21 @@ name: Testing on Windows
2
2
  on:
3
3
  - push
4
4
  - pull_request
5
+ permissions:
6
+ contents: read
7
+
5
8
  jobs:
6
9
  build:
7
10
  runs-on: ${{ matrix.os }}
8
11
  strategy:
9
12
  fail-fast: false
10
13
  matrix:
11
- ruby: [ '2.4', '2.5', '2.6' ]
14
+ ruby: [ '3.0', '3.1', '3.2' ]
12
15
  os:
13
16
  - windows-latest
14
17
  name: Ruby ${{ matrix.ruby }} unit testing on ${{ matrix.os }}
15
18
  steps:
16
- - uses: actions/checkout@v2
19
+ - uses: actions/checkout@v4
17
20
  - uses: ruby/setup-ruby@v1
18
21
  with:
19
22
  ruby-version: ${{ matrix.ruby }}
data/Gemfile CHANGED
@@ -4,8 +4,7 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem 'simplecov', require: false
7
- gem 'coveralls', ">= 0.8.0", require: false
8
7
  gem 'strptime', require: false if RUBY_ENGINE == "ruby" && RUBY_VERSION =~ /^2/
9
8
  gem "irb" if RUBY_ENGINE == "ruby" && RUBY_VERSION >= "2.6"
10
- gem "elasticsearch-xpack"
9
+ gem "elasticsearch-xpack" if ENV["USE_XPACK"]
11
10
  gem "oj"
data/History.md CHANGED
@@ -2,6 +2,152 @@
2
2
 
3
3
  ### [Unreleased]
4
4
 
5
+ ### 5.4.3
6
+ - add data_stream_template\_use\_index\_patterns\_wildcard in elasticsearch\_data\_stream (#1040)
7
+
8
+ ### 5.4.2
9
+ - in\_elasticsearch: Avoid to use deprecated endpoint for clear\_scroll (#1039)
10
+
11
+ ### 5.4.1
12
+ - Adjust ilm endpoint (#1036)
13
+
14
+ ### 5.4.0
15
+ - Fix support for host/hosts placeholders for ipv6 addresses (#1030)
16
+ - Handle newer es library (#1032)
17
+
18
+ ### 5.3.0
19
+
20
+ - Unpin `faraday` from v1, upgrade to v2. (#1012)
21
+ Note that if you can't migrate other plugins from `faraday` v1 yet, need to keep
22
+ fluent-plugin-elasticsearch v5.2.5.
23
+
24
+ ### 5.2.5
25
+
26
+ - Update the name of parameter about `thread_pool`.
27
+ It should be `thread_pool.write.queue_size` instead of `thread_pool.bulk.queue_size` (#1000)
28
+ - Replace obsolete `File.exists?` with `File.exist?` (#998)
29
+ - Support `compression_level` for `elasticsearch_data_stream` (#995)
30
+ - Honor `hosts` parameter for `elasticsearch_data_stream` (#1008)
31
+ - Drop outdated coveralls (#1009)
32
+
33
+ ### 5.2.4
34
+ - Pin Faraday 1.10 (#987)
35
+ - Increase errors metric on error response in data stream (#986)
36
+
37
+ ### 5.2.3
38
+ - Bump actions/checkout from 2 to 3 (#978)
39
+ - chore: Included githubactions in the dependabot config (#977)
40
+ - chore: Set permissions for GitHub actions (#972)
41
+ - Remove nested msgpack\_each in handle\_error (#970)
42
+ - do not overwrite @timestamp in data stream if it already exists in the record (#968)
43
+
44
+ ### 5.2.2
45
+ - Add missing top level class markers (#961)
46
+ - Ensure use_record_as_seed for same records (#960)
47
+
48
+ ### 5.2.1
49
+ - respect include\_tag\_key and tag\_key setting when using data streams (#936)
50
+ - Handle unsupported version error (#956)
51
+ - Display deprecated warning on ES dynamic plugin (#955)
52
+
53
+ ### 5.2.0
54
+ - Migrate to handle Elasticsearch 8 (#949)
55
+
56
+ ### 5.1.5
57
+ - Make retryable DataStreams creation at configure phase (#943)
58
+ - Handle @hosts parameter on data_stream plugin (#942)
59
+ - allow specifying custom ILM policies for data streams (#933)
60
+
61
+ ### 5.1.4
62
+ - Handle ES8 or above more strictly (#931)
63
+ - fixing double "\_policy" in index lifecycle management policy for elasticsearch\_data\_stream output (#930)
64
+
65
+ ### 5.1.3
66
+ - fixing execution order for dynamic data stream creation (#928)
67
+
68
+ ### 5.1.2
69
+ - Fix default values of datastream parameters (#926)
70
+
71
+ ### 5.1.1
72
+ - Report appropriate error for data_stream parameters (#922)
73
+ - Add ILM and template parameters for data streams (#920)
74
+ - Support Buffer in Data Stream Output (#917)
75
+
76
+ ### 5.1.0
77
+ - Correct default target bytes value (#914)
78
+ - Handle elasticsearch-ruby 7.14 properly (#913)
79
+
80
+ ### 5.0.5
81
+ - Drop json_parse_exception messages for bulk failures (#900)
82
+ - GitHub Actions: Drop Ruby 2.5 due to EOL (#894)
83
+
84
+ ### 5.0.4
85
+ - test: out_elasticsearch: Remove a needless headers from affinity stub (#888)
86
+ - Target Index Affinity (#883)
87
+
88
+ ### 5.0.3
89
+ - Fix use_legacy_template documentation (#880)
90
+ - Add FAQ for dynamic index/template (#878)
91
+ - Handle IPv6 address string on host and hosts parameters (#877)
92
+
93
+ ### 5.0.2
94
+ - GitHub Actions: Tweak Ruby versions on test (#875)
95
+ - test: datastreams: Set nonexistent datastream as default (#874)
96
+ - Fix overwriting of index template and index lifecycle policy on existing data streams (#872)
97
+
98
+ ### 5.0.1
99
+ - Use elasticsearch/api instead of elasticsearch/xpack (#870)
100
+
101
+ ### 5.0.0
102
+ - Support #retry_operate on data stream (#863)
103
+ - Support placeholder in @data\_stream\_name for @type elasticsearch\_data\_stream (#862)
104
+ - Extract troubleshooting section (#861)
105
+ - Fix unmatched `<source>` close tag (#860)
106
+ - Initial support for Elasticsearch Data Stream (#859)
107
+
108
+ ### 4.3.3
109
+ - Handle invalid Elasticsearch::Client#info response (#855)
110
+
111
+ ### 4.3.2
112
+ - Use log.debug to dump ES 8.x _type information (#852)
113
+
114
+ ### 4.3.1
115
+ - Unsplit huge records by default (#851)
116
+
117
+ ### 4.3.0
118
+ - Add cloud_id & cloud_auth settings (#850)
119
+ - Fix failing tests on es6 client (#848)
120
+ - feat: retry on transport errors (#846)
121
+ - fix typo (#838)
122
+ - Remove unnecessary nil check (#826)
123
+
124
+ ### 4.2.2
125
+ - Remove unnecessary nil check (#826)
126
+ - Fix ILM rollover index template pattern to apply index_separator (#825)
127
+ - Fix ILM rollover alias creation when a placeholder is used in index_name (#823)
128
+ - Add a note about the pitfalls of per-date indexes used with ILM (#822)
129
+
130
+ ### 4.2.1
131
+ - Update a broken link (#821)
132
+ - Include chunk_id in records (#820)
133
+ - Fix a failing testcase (#818)
134
+
135
+ ### 4.2.0
136
+ - ci: Add Ruby 2.7 jobs (#812)
137
+ - Support Elasticsearch new style template (#810)
138
+
139
+ ### 4.1.4
140
+ - ElasticsearchGenID update docs for hash_type (#809)
141
+ - Handle api key header (#808)
142
+ - index_template: Handle error object entirely on index creation failure (#807)
143
+
144
+ ### 4.1.3
145
+ - Load multiple templates even if template_name and template_file given (#799)
146
+ - Handle elasticsearch-ruby 7.9.0 using HTTP method changes (#795)
147
+
148
+ ### 4.1.2
149
+ - Use Hash#dig instead of Hash#[] on retrieving version information from Elasticsearch info API (#793)
150
+
5
151
  ### 4.1.1
6
152
  - Correct ILM explain on logstash_format case (#786)
7
153
 
@@ -17,7 +17,7 @@
17
17
  In your Fluentd configuration, use `@type elasticsearch_genid`. Additional configuration is optional, default values would look like this:
18
18
 
19
19
  ```
20
- <source>
20
+ <filter>
21
21
  @type elasticsearch_genid
22
22
  hash_id_key _hash
23
23
  include_tag_in_seed false
@@ -26,8 +26,8 @@ In your Fluentd configuration, use `@type elasticsearch_genid`. Additional confi
26
26
  use_entire_record false
27
27
  record_keys []
28
28
  separator _
29
- hash_type md5
30
- </match>
29
+ hash_type sha1
30
+ </filter>
31
31
  ```
32
32
 
33
33
  ## Configuration
@@ -95,7 +95,7 @@ You can specify separator charactor to creating seed for hash generation.
95
95
  hash_type sha1
96
96
  ```
97
97
 
98
- You can specify hash algorithm.
98
+ You can specify hash algorithm. Support algorithms `md5`, `sha1`, `sha256`, `sha512`. Default: `sha1`
99
99
 
100
100
  ## Advanced Usage
101
101
 
@@ -37,7 +37,7 @@ In your Fluentd configuration, use `@type elasticsearch` and specify `tag your.a
37
37
  index_name fluentd
38
38
  type_name fluentd
39
39
  tag my.logs
40
- </match>
40
+ </source>
41
41
  ```
42
42
 
43
43
  ## Configuration