Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust Logstash example query quotes #5457

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Adjust Logstash example query quotes #5457

merged 1 commit into from
Nov 8, 2023

Conversation

znwilkins
Copy link
Contributor

Description

The example for reading from Opensearch using Logstash specifies double quotes around a query containing double quotes. This causes the Ruby parser to complain with an error of the form:

message=>"Expected one of [ \\t\\r\\n], \"#\", \"{\", \"}\" at line 7, column 24 (byte 256) after input {\n  opensearch {\n    hosts       => \"https://myhost.com:443\"\n    user        => \"myuser\"\n    password    => \"password\"\n    index       => \"myindex\"\n    query       => \"{ \""

Swapping to single quotes resolves the issue. If this PR is accepted, an identical change should also be made to the plugin README (I'm happy to open another PR).

Thanks!

Issues Resolved

N/A

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Change double quote to single quote on query

Signed-off-by: Zachary Wilkins <[email protected]>
@Naarcha-AWS
Copy link
Collaborator

@znwilkins: Is it only the Query setting that requires single quotes?

@znwilkins
Copy link
Contributor Author

@Naarcha-AWS yes that's correct. The other settings do not contain double quotes within the string so are not affected. I also tried escaping the double quotes for query/match_all ("{ \"query\": { \"match_all\": {}} }") but this did not work.

@Naarcha-AWS Naarcha-AWS added the backport 2.11 PR: Backport label for 2.11 label Nov 8, 2023
@Naarcha-AWS Naarcha-AWS merged commit 77bcd03 into opensearch-project:main Nov 8, 2023
4 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 8, 2023
Change double quote to single quote on query

Signed-off-by: Zachary Wilkins <[email protected]>
(cherry picked from commit 77bcd03)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Naarcha-AWS pushed a commit that referenced this pull request Nov 8, 2023
Change double quote to single quote on query


(cherry picked from commit 77bcd03)

Signed-off-by: Zachary Wilkins <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vagimeli pushed a commit that referenced this pull request Dec 21, 2023
Change double quote to single quote on query

Signed-off-by: Zachary Wilkins <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.11 PR: Backport label for 2.11
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants