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

added index, document_id and empty query return #1017

Closed
wants to merge 2 commits into from

Conversation

codyit
Copy link

@codyit codyit commented Feb 3, 2014

Improved elasticsearch filter.
Added fields
Specify index to be logstash-* by default.
Capture document_id for use in output overwriting.

Return properly if nothing is found.


@fields.each do |old, new|
event[new] = results['hits']['hits'][0]['_source'][old]
end

unless @document_id.nil?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double negative ;)

We can just do: if @document_id

@codyit
Copy link
Author

codyit commented Feb 17, 2014

The double negative is fixed. :)
Should make it clear that the version before the patch doesn't work properly, for our installation it only search in the kibana index, so it is also a bug fix.

@codyit
Copy link
Author

codyit commented Jun 29, 2014

I guess no one notice the plugin wouldn't work with >1 index = no real use case for this plugin = not worth caring :E

@elasticsearch-release
Copy link

Can one of the admins verify this patch?

@jamtur01
Copy link
Contributor

Well it needs to be rebased.

@codyit
Copy link
Author

codyit commented Jun 30, 2014

done.

@wiibaa
Copy link
Contributor

wiibaa commented Dec 2, 2014

@codyit sorry to bother you once more, could you review your proposal on top of existing https://github.com/logstash-plugins/logstash-filter-elasticsearch and if relevant move your PR there. Thanks

@codyit
Copy link
Author

codyit commented Dec 11, 2014

From the look of it the code would still fail if there are more than one index unless I'm missing something. It's been a long time since I touched it, and there are active contributors over there, I'll create an issue there instead.

@codyit
Copy link
Author

codyit commented Dec 11, 2014

@jordansissel
Copy link
Contributor

For Logstash 1.5.0, we've moved all plugins (and grok patterns) to individual repositories. Can you move this pull request to https://github.com/logstash-plugins/logstash-filter-elasticsearch?

This sequence of steps may help you do this migration:

  1. Fork this repository

  2. Clone your fork

    git clone https://github.com/codyit/logstash.git
  3. Create a branch:

    git checkout -b my-branch-name
  4. Apply the patches from this PR into your branch:

    curl -s https://github.com/elastic/logstash/pull/1017.patch | git am

    This should take your commits from this PR and commit them to your new local branch.

  5. Push!

    git push origin my-branch-name
  6. Open a new PR against https://github.com/logstash-plugins/logstash-filter-elasticsearch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants