logstash-input-opensearch 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: b83bb97c29028280c7d43ebe0d845d32ef95ecd747327fd9cd1fcd29194cef6a
4
+ data.tar.gz: bdae4dc0599356fd0a4fcdb27e93e7168ab5856b59752f6aef0d121c220382e2
5
+ SHA512:
6
+ metadata.gz: bab3fbda2e598a309e254c2b2916db75245de8d9a07829d5ea88b15b49f67e29ffc5057c7c42c5879c26177e24ef7a6cba9717489dc5182d1df20288d0398dbf
7
+ data.tar.gz: b958eeebcc973b6fe3b969ee1db7aaefc940a67e6a4de03618de8352bd1639a5401642ad6e147f79ccfac2990244a0e63d79ecfa34ac7aee1e46a18765f4c9fb
checksums.yaml.gz.sig ADDED
Binary file
data/ADMINS.md ADDED
@@ -0,0 +1,28 @@
1
+ ## Overview
2
+
3
+ This document explains who the admins are (see below), what they do in this repo, and how they should be doing it. If you're interested in becoming a maintainer, see [MAINTAINERS](MAINTAINERS.md). If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
4
+
5
+ ## Current Admins
6
+
7
+ | Admin | GitHub ID | Affiliation |
8
+ | ---------------- | ------------------------------------------------------ | ----------- |
9
+ | Henri Yandell | [hyandell](https://github.com/hyandell) | Amazon |
10
+ | Naveen Tatikonda | [naveentatikonda](https://github.com/naveentatikonda) | Amazon |
11
+
12
+ ## Admin Responsibilities
13
+
14
+ As an admin you own stewartship of the repository and its settings. Admins have [admin-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and protect the repository as follows.
15
+
16
+ ### Prioritize Security
17
+
18
+ Security is your number one priority. Manage security keys and safeguard access to the repository.
19
+
20
+ Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](SECURITY.md) for details.
21
+
22
+ ### Enforce Code of Conduct
23
+
24
+ Act on [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) violations by revoking access, and blocking malicious actors.
25
+
26
+ ### Adopt Organizational Best Practices
27
+
28
+ Adopt organizational best practices, work in the open, and collaborate with other admins by opening issues before making process changes. Prefer consistency, and avoid diverging from practices in the opensearch-project organization.
@@ -0,0 +1,24 @@
1
+ This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project.
2
+
3
+
4
+ **Our open source communities endeavor to:**
5
+
6
+ * Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
7
+ * Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
8
+ * Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
9
+ * Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.
10
+
11
+
12
+ **Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:**
13
+
14
+ * The use of violent threats, abusive, discriminatory, or derogatory language;
15
+ * Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
16
+ * Posting of sexually explicit or violent content;
17
+ * The use of sexualized language and unwelcome sexual attention or advances;
18
+ * Public or private harassment of any kind;
19
+ * Publishing private information, such as physical or electronic address, without permission;
20
+ * Other conduct which could reasonably be considered inappropriate in a professional setting;
21
+ * Advocating for or encouraging any of the above behaviors.
22
+ * Enforcement and Reporting Code of Conduct Issues:
23
+
24
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:opensource-codeofconduct@amazon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,121 @@
1
+ - [Contributing to OpenSearch](#contributing-to-opensearch)
2
+ - [First Things First](#first-things-first)
3
+ - [Ways to Contribute](#ways-to-contribute)
4
+ - [Bug Reports](#bug-reports)
5
+ - [Feature Requests](#feature-requests)
6
+ - [Contributing Code](#contributing-code)
7
+ - [Developer Certificate of Origin](#developer-certificate-of-origin)
8
+ - [License Headers](#license-headers)
9
+ - [Review Process](#review-process)
10
+
11
+ ## Contributing to OpenSearch
12
+
13
+ OpenSearch is a community project that is built and maintained by people just like **you**. We're glad you're interested in helping out. There are several different ways you can do it, but before we talk about that, let's talk about how to get started.
14
+
15
+ ## First Things First
16
+
17
+ 1. **When in doubt, open an issue** - For almost any type of contribution, the first step is opening an issue. Even if you think you already know what the solution is, writing down a description of the problem you're trying to solve will help everyone get context when they review your pull request. If it's truly a trivial change (e.g. spelling error), you can skip this step -- but as the subject says, when it doubt, [open an issue](https://github.com/opensearch-project/logstash-input-opensearch/issues).
18
+
19
+ 2. **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin).
20
+
21
+ ## Ways to Contribute
22
+
23
+ ### Bug Reports
24
+
25
+ Ugh! Bugs!
26
+
27
+ A bug is when software behaves in a way that you didn't expect and the developer didn't intend. To help us understand what's going on, we first want to make sure you're working from the latest version.
28
+
29
+ Once you've confirmed that the bug still exists in the latest version, you'll want to check to make sure it's not something we already know about on the [open issues GitHub page](https://github.com/opensearch-project/logstash-input-opensearch/issues).
30
+
31
+ If you've upgraded to the latest version and you can't find it in our open issues list, then you'll need to tell us how to reproduce it Provide as much information as you can. You may think that the problem lies with your query, when actually it depends on how your data is indexed. The easier it is for us to recreate your problem, the faster it is likely to be fixed.
32
+
33
+ ### Feature Requests
34
+
35
+ If you've thought of a way that OpenSearch could be better, we want to hear about it. We track feature requests using GitHub, so please feel free to open an issue which describes the feature you would like to see, why you need it, and how it should work.
36
+
37
+ ### Contributing Code
38
+
39
+ As with other types of contributions, the first step is to [open an issue on GitHub](https://github.com/opensearch-project/logstash-input-opensearch/issues/new/choose). Opening an issue before you make changes makes sure that someone else isn't already working on that particular problem. It also lets us all work together to find the right approach before you spend a bunch of time on a PR. So again, when in doubt, open an issue.
40
+
41
+ ## Developer Certificate of Origin
42
+
43
+ OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software.
44
+
45
+ We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.
46
+
47
+ The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/).
48
+
49
+ ```
50
+ Developer's Certificate of Origin 1.1
51
+
52
+ By making a contribution to this project, I certify that:
53
+
54
+ (a) The contribution was created in whole or in part by me and I
55
+ have the right to submit it under the open source license
56
+ indicated in the file; or
57
+
58
+ (b) The contribution is based upon previous work that, to the
59
+ best of my knowledge, is covered under an appropriate open
60
+ source license and I have the right under that license to
61
+ submit that work with modifications, whether created in whole
62
+ or in part by me, under the same open source license (unless
63
+ I am permitted to submit under a different license), as
64
+ Indicated in the file; or
65
+
66
+ (c) The contribution was provided directly to me by some other
67
+ person who certified (a), (b) or (c) and I have not modified
68
+ it.
69
+
70
+ (d) I understand and agree that this project and the contribution
71
+ are public and that a record of the contribution (including
72
+ all personal information I submit with it, including my
73
+ sign-off) is maintained indefinitely and may be redistributed
74
+ consistent with this project or the open source license(s)
75
+ involved.
76
+ ```
77
+
78
+ We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms.
79
+
80
+ Each commit must include a DCO which looks like this
81
+
82
+ ```
83
+ Signed-off-by: Jane Smith <jane.smith@email.com>
84
+ ```
85
+
86
+ You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message.
87
+
88
+ ## License Headers
89
+
90
+ New files in your code contributions should contain the following license header. If you are modifying existing files with license headers, or including new files that already have license headers, do not remove or modify them without guidance.
91
+
92
+ ### Java
93
+
94
+ ```
95
+ /*
96
+ * Copyright OpenSearch Contributors
97
+ * SPDX-License-Identifier: Apache-2.0
98
+ */
99
+ ```
100
+
101
+ ### Python
102
+ ```
103
+ # Copyright OpenSearch Contributors
104
+ # SPDX-License-Identifier: Apache-2.0
105
+ ```
106
+
107
+ ### Shell
108
+ ```
109
+ # Copyright OpenSearch Contributors
110
+ # SPDX-License-Identifier: Apache-2.0
111
+ ```
112
+
113
+ ## Review Process
114
+
115
+ We deeply appreciate everyone who takes the time to make a contribution. We will review all contributions as quickly as possible. As a reminder, [opening an issue](ihttps://github.com/opensearch-project/logstash-input-opensearch/issues/new/choose) discussing your change before you make it is the best way to smooth the PR process. This will prevent a rejection because someone else is already working on the problem, or because the solution is incompatible with the architectural direction.
116
+
117
+ During the PR process, expect that there will be some back-and-forth. Please try to respond to comments in a timely fashion, and if you don't wish to continue with the PR, let us know. If a PR takes too many iterations for its complexity or size, we may reject it. Additionally, if you stop responding we may close the PR as abandoned. In either case, if you feel this was done in error, please add a comment on the PR.
118
+
119
+ If we accept the PR, a [maintainer](MAINTAINERS.md) will merge your change and usually take care of backporting it to appropriate branches ourselves.
120
+
121
+ If we reject the PR, we will close the pull request with a comment explaining why. This decision isn't always final: if you feel we have misunderstood your intended change or otherwise think that we should reconsider then please continue the conversation with a comment on the PR and we'll do our best to address any further points you raise.
@@ -0,0 +1,77 @@
1
+ # Developer Guide
2
+
3
+ So you want to contribute code to logstash-input-opensearch? Excellent! We're glad you're here. Here's what you need to do.
4
+
5
+ ## 1. Plugin Developement and Testing
6
+
7
+ ### Code
8
+ - To get started, you'll need JRuby with the Bundler gem installed.
9
+
10
+ - Fork [opensearch-project/logstash-input-opensearch](https://github.com/opensearch-project/logstash-input-opensearch) and clone locally.
11
+
12
+ Example:
13
+ ```bash
14
+ git clone https://github.com/[your username]/logstash-input-opensearch.git.
15
+ ```
16
+
17
+
18
+ - Install dependencies
19
+ ```sh
20
+ bundle install
21
+ ```
22
+
23
+ ### Test
24
+
25
+ - Update your dependencies
26
+
27
+ ```sh
28
+ bundle install
29
+ ```
30
+
31
+ - Run tests
32
+
33
+ ```sh
34
+ bundle exec rspec
35
+ ```
36
+
37
+ ## 2. Running your unpublished Plugin in Logstash
38
+
39
+ ### 2.1 Run in a local Logstash clone
40
+
41
+ - Edit Logstash `Gemfile` and add the local plugin path, for example:
42
+ ```ruby
43
+ gem "logstash-input-opensearch", :path => "/your/local/logstash-input-opensearch"
44
+ ```
45
+ - Install plugin
46
+ ```sh
47
+ # Logstash 2.3 and higher
48
+ bin/logstash-plugin install --no-verify
49
+
50
+ # Prior to Logstash 2.3
51
+ bin/plugin install --no-verify
52
+
53
+ ```
54
+ - Run Logstash with your plugin
55
+ ```sh
56
+ bin/logstash -e 'input {opensearch {}}'
57
+ ```
58
+ At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
59
+
60
+ ### 2.2 Run in an installed Logstash
61
+
62
+ You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
63
+
64
+ - Build your plugin gem
65
+ ```sh
66
+ gem build logstash-input-opensearch.gemspec
67
+ ```
68
+ - Install the plugin from the Logstash home
69
+ ```sh
70
+ # Logstash 2.3 and higher
71
+ bin/logstash-plugin install --no-verify
72
+
73
+ # Prior to Logstash 2.3
74
+ bin/plugin install --no-verify
75
+
76
+ ```
77
+ - Start Logstash and proceed to test the plugin
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # Copyright OpenSearch Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ source 'https://rubygems.org'
5
+
6
+ gemspec
7
+
8
+ logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
9
+ use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
10
+
11
+ if Dir.exist?(logstash_path) && use_logstash_source
12
+ gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
13
+ gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
14
+ end
data/MAINTAINERS.md ADDED
@@ -0,0 +1,82 @@
1
+ - [Overview](#overview)
2
+ - [Current Maintainers](#current-maintainers)
3
+ - [Maintainer Responsibilities](#maintainer-responsibilities)
4
+ - [Uphold Code of Conduct](#uphold-code-of-conduct)
5
+ - [Prioritize Security](#prioritize-security)
6
+ - [Review Pull Requests](#review-pull-requests)
7
+ - [Triage Open Issues](#triage-open-issues)
8
+ - [Be Responsive](#be-responsive)
9
+ - [Maintain Overall Health of the Repo](#maintain-overall-health-of-the-repo)
10
+ - [Add Continuous Integration Checks](#add-continuous-integration-checks)
11
+ - [Developer Certificate of Origin Workflow](#developer-certificate-of-origin-workflow)
12
+ - [Use Semver](#use-semver)
13
+ - [Release Frequently](#release-frequently)
14
+ - [Promote Other Maintainers](#promote-other-maintainers)
15
+ - [Describe the Repo](#describe-the-repo)
16
+
17
+ ## Overview
18
+
19
+ This document explains who the maintainers are (see below), what they do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
20
+
21
+ ## Current Maintainers
22
+
23
+ | Maintainer | GitHub ID | Affiliation |
24
+ | ------------------------ | ------------------------------------------------------ | ----------- |
25
+ | Naveen Tatikonda | [naveentatikonda](https://github.com/naveentatikonda) | Amazon |
26
+ | Vamshi Vijay Nakkirtha | [vamshin](https://github.com/vamshin) | Amazon |
27
+
28
+ ## Maintainer Responsibilities
29
+
30
+ Maintainers are active and visible members of the community, and have [maintain-level permissions on a repository](https://docs.github.com/en/organizations/managing-access-to-your-organizations-repositories/repository-permission-levels-for-an-organization). Use those privileges to serve the community and evolve code as follows.
31
+
32
+ ### Uphold Code of Conduct
33
+
34
+ Model the behavior set forward by the [Code of Conduct](CODE_OF_CONDUCT.md) and raise any violations to other maintainers and admins.
35
+
36
+ ### Prioritize Security
37
+
38
+ Security is your number one priority. Maintainer's Github keys must be password protected securely and any reported security vulnerabilities are addressed before features or bugs.
39
+
40
+ Note that this repository is monitored and supported 24/7 by Amazon Security, see [Reporting a Vulnerability](SECURITY.md) for details.
41
+
42
+ ### Review Pull Requests
43
+
44
+ Review pull requests regularly, comment, suggest, reject, merge and close. Accept only high quality pull-requests. Provide code reviews and guidance on incomming pull requests. Don't let PRs be stale and do your best to be helpful to contributors.
45
+
46
+ ### Triage Open Issues
47
+
48
+ Manage labels, review issues regularly, and triage by labelling them.
49
+
50
+ All repositories in this organization have a standard set of labels, including `bug`, `documentation`, `duplicate`, `enhancement`, `good first issue`, `help wanted`, `blocker`, `invalid`, `question`, `wontfix`, and `untriaged`, along with release labels, such as `v1.0.0`, `v1.1.0`, `v2.0.0`, `patch`, and `backport`.
51
+
52
+ Use labels to target an issue or a PR for a given release, add `help wanted` to good issues for new community members, and `blocker` for issues that scare you or need immediate attention. Request for more information from a submitter if an issue is not clear. Create new labels as needed by the project.
53
+
54
+ ### Be Responsive
55
+
56
+ Respond to enhancement requests, and forum posts. Allocate time to reviewing and commenting on issues and conversations as they come in.
57
+
58
+ ### Maintain Overall Health of the Repo
59
+
60
+ Keep the `main` branch at production quality at all times. Backport features as needed. Cut release branches and tags to enable future patches.
61
+
62
+ ### Add Continuous Integration Checks
63
+
64
+ Add integration checks that validate pull requests and pushes to ease the burden on Pull Request reviewers.
65
+
66
+ #### Developer Certificate of Origin Workflow
67
+
68
+ Validates pull requests commits are all signed with DCO, [dco.yml](./.github/workflows/dco.yml). Example [pull request](https://github.com/opensearch-project/opensearch-ci/pull/16).
69
+
70
+ ### Use Semver
71
+
72
+ Use and enforce [semantic versioning](https://semver.org/) and do not let breaking changes be made outside of major releases.
73
+
74
+ ### Release Frequently
75
+
76
+ Make frequent project releases to the community.
77
+
78
+ ### Promote Other Maintainers
79
+
80
+ Assist, add, and remove [MAINTAINERS](MAINTAINERS.md). Exercise good judgement, and propose high quality contributors to become co-maintainers.
81
+
82
+ ### Describe the Repo
data/README.md ADDED
@@ -0,0 +1,62 @@
1
+ [![Build and Test logstash-input-opensearch plugin](https://github.com/opensearch-project/logstash-input-opensearch/actions/workflows/CI.yml/badge.svg)](https://github.com/opensearch-project/logstash-input-opensearch/actions/workflows/CI.yml)
2
+ ![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success)
3
+ # Logstash Input OpenSearch
4
+
5
+ - [Welcome!](#welcome)
6
+ - [Project Resources](#project-resources)
7
+ - [Configuration for Logstash Input OpenSearch Plugin](#configuration-for-logstash-input-opensearch-plugin)
8
+ - [Code of Conduct](#code-of-conduct)
9
+ - [License](#license)
10
+ - [Copyright](#copyright)
11
+
12
+ ## Welcome!
13
+
14
+ **logstash-input-opensearch** is a community-driven, open source fork logstash-input-elasticsearch licensed under the [Apache v2.0 License](LICENSE.txt). For more information, see [opensearch.org](https://opensearch.org/).
15
+
16
+ The logstash-input-opensearch plugin helps to read the search query results performed on an OpenSearch cluster. This is useful for replaying test logs, reindexing, etc. This helps users to periodically schedule ingestion using cron syntax (using `schedule` configuration setting) or by running the query one time to load data into Logstash.
17
+
18
+ ## Project Resources
19
+
20
+ * [Project Website](https://opensearch.org/)
21
+ * [Documentation](https://opensearch.org/docs/clients/logstash/index/)
22
+ * [Developer Guide](DEVELOPER_GUIDE.md)
23
+ * Need help? Try [Forums](https://discuss.opendistrocommunity.dev/)
24
+ * [Project Principles](https://opensearch.org/#principles)
25
+ * [Contributing to OpenSearch](CONTRIBUTING.md)
26
+ * [Maintainer Responsibilities](MAINTAINERS.md)
27
+ * [Release Management](RELEASING.md)
28
+ * [Admin Responsibilities](ADMINS.md)
29
+ * [Security](SECURITY.md)
30
+
31
+ ## Configuration for Logstash Input OpenSearch Plugin
32
+
33
+ To run the Logstash Input OpenSearch plugin, add following configuration in your logstash.conf file.
34
+ ```
35
+ input {
36
+ opensearch {
37
+ hosts => ["hostname:port"]
38
+ user => "admin"
39
+ password => "admin"
40
+ index => "logstash-logs-%{+YYYY.MM.dd}"
41
+ query => "{ "query": { "match_all": {}} }"
42
+ }
43
+ }
44
+ ```
45
+
46
+ Using the above configuration, the `match_all` query filter is triggered and data is loaded once.
47
+
48
+ `schedule` setting can be used to periodically schedule ingestion using cron syntax.
49
+
50
+ Example: `schedule => "* * * * *"` Adding this to the above configuration loads the data every minute.
51
+
52
+ ## Code of Conduct
53
+
54
+ This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [opensource-codeofconduct@amazon.com](mailto:opensource-codeofconduct@amazon.com) with any additional questions or comments.
55
+
56
+ ## License
57
+
58
+ This project is licensed under the [Apache v2.0 License](LICENSE.txt).
59
+
60
+ ## Copyright
61
+
62
+ Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
data/RELEASING.md ADDED
@@ -0,0 +1,111 @@
1
+ - [Overview](#overview)
2
+ - [Branching](#branching)
3
+ - [OpenSearch Branching](#opensearch-branching)
4
+ - [Plugin Branching](#plugin-branching)
5
+ - [Feature Branches](#feature-branches)
6
+ - [Versioning](#versioning)
7
+ - [Version Numbers](#version-numbers)
8
+ - [Incrementing Versions](#incrementing-versions)
9
+ - [Tagging](#tagging)
10
+ - [Release Labels](#release-labels)
11
+ - [Releasing](#releasing)
12
+ - [Backporting](#backporting)
13
+
14
+ ## Overview
15
+
16
+ This document explains the release strategy for artifacts in this organization.
17
+
18
+ ## Branching
19
+
20
+ Projects create a new branch when they need to start working on 2 separate versions of the product, with the `main` branch being the furthermost release.
21
+
22
+ ### OpenSearch Branching
23
+
24
+ [OpenSearch](https://github.com/opensearch-project/OpenSearch) typically tracks 3 releases in parallel. For example, given the last major release of 1.0, OpenSearch in this organization maintains the following active branches.
25
+
26
+ * **main**: The _next major_ release, currently 2.0. This is the branch where all merges take place, and code moves fast.
27
+ * **1.x**: The _next minor_ release, currently 1.1. Once a change is merged into `main`, decide whether to backport it to `1.x`.
28
+ * **1.0**: The _current_ release, currently 1.0. In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. The next release out of this branch will be 1.0.1.
29
+
30
+ Label PRs with the next major version label (e.g. `2.0.0`) and merge changes into `main`. Label PRs that you believe need to be backported as `1.x` and `1.0`. Backport PRs by checking out the versioned branch, cherry-pick changes and open a PR against each target backport branch.
31
+
32
+ ### Plugin Branching
33
+
34
+ Plugins, such as [job-scheduler](https://github.com/opensearch-project/job-scheduler) aren't as active as OpenSearch, and typically track 2 releases in parallel instead of 3. This still translates into 3 branches. For example, given the last major release of 1.0, job-scheduler maintains the following.
35
+
36
+ * **main**: The _next_ release, currently 1.1. This is the branch where all merges take place, and code moves fast.
37
+ * **1.x**: A common parent branch for the series of 1.x releases. This is where 1.x patches will be made when `main` becomes 2.0.
38
+ * **1.0**: The _current_ release, currently 1.0. This branch's parent is `1.x` to make future merges easier. 'In between minor releases, only hotfixes (e.g. security) are backported to `1.0`. The next release out of this branch will be 1.0.1.
39
+
40
+ ### Feature Branches
41
+
42
+ Do not creating branches in the upstream repo, use your fork, for the exception of long lasting feature branches that require active collaboration from multiple developers. Name feature branches `feature/<thing>`. Once the work is merged to `main`, please make sure to delete the feature branch.
43
+
44
+ ## Versioning
45
+
46
+ OpenSearch versioning [follows semver](https://opensearch.org/blog/technical-post/2021/08/what-is-semver/).
47
+
48
+ ### Version Numbers
49
+
50
+ The build number of the engine is 3-digit `major.minor.patch` (e.g. `1.1.0`), while plugins use 4 digits (`1.1.0.45`). See [OpenSearch#1093](https://github.com/opensearch-project/OpenSearch/issues/1093) for a proposal to remove this difference.
51
+
52
+ ### Incrementing Versions
53
+
54
+ Versions are incremented as soon as development starts on a given version to avoid confusion. In the examples above versions are as follows.
55
+
56
+ * OpenSearch: `main` = 2.0.0, `1.x` = 1.1.0, and `1.0` = 1.0.0
57
+ * job-scheduler: `main` = 1.1.0.0, `1.0` = 1.0.0.0
58
+
59
+ ## Tagging
60
+
61
+ Create tags after a release that match the version number, `major.minor.patch`, without a `v` prefix.
62
+
63
+ * [OpenSearch tags](https://github.com/opensearch-project/OpenSearch/tags): [1.0.0](https://github.com/opensearch-project/OpenSearch/releases/tag/1.0.0)
64
+ * [job-scheduler tags](https://github.com/opensearch-project/job-scheduler/tags): [1.0.0.0](https://github.com/opensearch-project/job-scheduler/releases/tag/1.0.0.0)
65
+
66
+ For a discussion on whether to add a prefixing `v` to release tags, see [#35](https://github.com/opensearch-project/.github/issues/35).
67
+
68
+ ## Release Labels
69
+
70
+ Repositories create consistent release labels, such as `v1.0.0`, `v1.1.0` and `v2.0.0`, as well as `patch` and `backport`. Use release labels to target an issue or a PR for a given release. See [MAINTAINERS](MAINTAINERS.md#triage-open-issues) for more information on triaging issues.
71
+
72
+ ## Releasing
73
+
74
+ The OpenSearch release process is centralized.
75
+
76
+ 1. Two candidate bundle builds for OpenSearch and OpenSearch Dashboards, produced by bundle-workflow, are chosen as release candidates. Those artifacts have successful end-to-end integration, backwards-compatibility and performance tests, and are signed.
77
+ 2. Staged maven artifacts are promoted to Maven Central.
78
+ 3. Bundles and -min artifacts are published to [opensearch.org](https://opensearch.org/downloads.html).
79
+
80
+ ## Backporting
81
+
82
+ This project follows [semantic versioning](https://semver.org/spec/v2.0.0.html). Backwards-incompatible changes always result in a new major version and will __never__ be backported. Small improvements and features will be backported to a new minor version (e.g. `1.1`). Security fixes will be backported to a new patch version (e.g. `1.0.1`).
83
+
84
+ Here are the commands we typically run to backport changes to release branches:
85
+
86
+ 1. Checkout the target release branch and pull the latest changes from `upstream`. In the examples below, our target release branch is `1.x`.
87
+
88
+ ```
89
+ git checkout 1.x
90
+ git pull upstream 1.x
91
+ ```
92
+
93
+ 2. Create a local branch for the backport. A convenient naming convention is _backport-\[PR-id\]-\[target-release-branch\]_.
94
+
95
+ ```
96
+ git checkout -b backport-pr-xyz-1.x
97
+ ```
98
+
99
+ 3. Cherry-pick the commit to backport. Remember to include [DCO signoff](CONTRIBUTING.md#developer-certificate-of-origin).
100
+
101
+ ```
102
+ git cherry-pick <commit-id> -s
103
+ ```
104
+
105
+ 4. Push the local branch to your fork.
106
+
107
+ ```
108
+ git push origin backport-pr-xyz-1.x
109
+ ```
110
+
111
+ 5. Create a pull request for the change.
data/SECURITY.md ADDED
@@ -0,0 +1,3 @@
1
+ ## Reporting a Vulnerability
2
+
3
+ If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/) or directly via email to aws-security@amazon.com. Please do **not** create a public GitHub issue.
@@ -0,0 +1,52 @@
1
+ # Copyright OpenSearch Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ require 'opensearch'
5
+ require 'opensearch/transport/transport/connections/selector'
6
+
7
+ # elasticsearch-transport versions prior to 7.2.0 suffered of a race condition on accessing
8
+ # the connection pool. This issue was fixed (in 7.2.0) with
9
+ # https://github.com/elastic/elasticsearch-ruby/commit/15f9d78591a6e8823948494d94b15b0ca38819d1
10
+ #
11
+ # This plugin, at the moment, is using elasticsearch >= 5.0.5
12
+ # When this requirement ceases, this patch could be removed.
13
+ module OpenSearch
14
+ module Transport
15
+ module Transport
16
+ module Connections
17
+ module Selector
18
+
19
+ # "Round-robin" selector strategy (default).
20
+ #
21
+ class RoundRobin
22
+ include Base
23
+
24
+ # @option arguments [Connections::Collection] :connections Collection with connections.
25
+ #
26
+ def initialize(arguments = {})
27
+ super
28
+ @mutex = Mutex.new
29
+ @current = nil
30
+ end
31
+
32
+ # Returns the next connection from the collection, rotating them in round-robin fashion.
33
+ #
34
+ # @return [Connections::Connection]
35
+ #
36
+ def select(options={})
37
+ @mutex.synchronize do
38
+ conns = connections
39
+ if @current && (@current < conns.size-1)
40
+ @current += 1
41
+ else
42
+ @current = 0
43
+ end
44
+ conns[@current]
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,44 @@
1
+ # Copyright OpenSearch Contributors
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ # encoding: utf-8
5
+ require "opensearch"
6
+ require "opensearch/transport/transport/http/manticore"
7
+
8
+
9
+ # elasticsearch-transport 7.2.0 - 7.14.0 had a bug where setting http headers
10
+ # ES::Client.new ..., transport_options: { headers: { 'Authorization' => ... } }
11
+ # would be lost https://github.com/elastic/elasticsearch-ruby/issues/1428
12
+ #
13
+ # NOTE: needs to be idempotent as filter OpenSearch plugin might apply the same patch!
14
+ #
15
+ # @private
16
+ module OpenSearch
17
+ module Transport
18
+ module Transport
19
+ module HTTP
20
+ class Manticore
21
+
22
+ def apply_headers(request_options, options)
23
+ headers = (options && options[:headers]) || {}
24
+ headers[CONTENT_TYPE_STR] = find_value(headers, CONTENT_TYPE_REGEX) || DEFAULT_CONTENT_TYPE
25
+
26
+ # this code is necessary to grab the correct user-agent header
27
+ # when this method is invoked with apply_headers(@request_options, options)
28
+ # from https://github.com/opensearch-project/opensearch-ruby/blob/main/opensearch-transport/lib/opensearch/transport/transport/http/manticore.rb#L122-L123
29
+ transport_user_agent = nil
30
+ if (options && options[:transport_options] && options[:transport_options][:headers])
31
+ transport_headers = options[:transport_options][:headers]
32
+ transport_user_agent = find_value(transport_headers, USER_AGENT_REGEX)
33
+ end
34
+
35
+ headers[USER_AGENT_STR] = transport_user_agent || find_value(headers, USER_AGENT_REGEX) || user_agent_header
36
+ headers[ACCEPT_ENCODING] = GZIP if use_compression?
37
+ (request_options[:headers] ||= {}).merge!(headers) # this line was changed
38
+ end
39
+
40
+ end
41
+ end
42
+ end
43
+ end
44
+ end