-
Notifications
You must be signed in to change notification settings - Fork 307
Added support for routing parameters. #65
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
Conversation
Code looks good, I think. I haven't tested it. |
I copied the parameter description from PR #64 to my code as it is better and more descriptive. |
Ah, I didn't realize there was more work which was needed. Though, I definitely missed adding a test! I'll close out #64 in support of this. |
Is there anything else needed for this PR to be reviewed, tested and merged? It looks like the tests failed due to a CLA issue but it also seems like the QA process is not updated for the new plugins repo organization. |
@masteinhauser time. We'll tend to this soon. We are focusing on other priorities at this time. |
Ah, understood. I will package and keep my own internally. Thanks! |
@@ -73,6 +73,75 @@ | |||
end | |||
end | |||
|
|||
describe "ship lots of events w/ default index_type and fixed routing key", :elasticsearch => true do | |||
# Generate a random index name | |||
index = 10.times.collect { rand(10).to_s }.join("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go into a let variable (more info at https://relishapp.com/rspec/rspec-core/v/3-2/docs/helper-methods/let-and-let )
@talevy can you take over review on this? @purbon is going on vacation (WOO) and I'd like to help move this forward for our friend @cdahlqvist :) |
@talevy Added test for dynamic routing parameter as discussed. |
@cdahlqvist thanks! I'll try to check it out and test locally soon and get back to you! |
@cdahlqvist why did you change all the |
@cdahlqvist I also see that there are a few |
@@ -56,7 +56,7 @@ | |||
response.read_body { |chunk| data << chunk } | |||
result = LogStash::Json.load(data) | |||
count = result["count"] | |||
insist { count } == event_count | |||
expect { count } == event_count |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have traditionally been using insist
for such assertions. I think we should keep it with insist
for the sake of keeping this PR's main goal to add the _routing
functionality
data = "" | ||
response.read_body { |chunk| data << chunk } | ||
result = LogStash::Json.load(data) | ||
count = result["count"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
result["count"]
should be result['hits']['hits'].size
I also notice that many of the tests for routing simply check document counts from request with routing parameters. you may simply want to call the count api, and check count, instead of calling search |
That is a very good point. Will modify to instead use the count API and correct the syntax. |
we can go ahead and change |
@talevy Changed back to using expect. Hopefully it will work properly now. |
@talevy Have merged changes from master. |
@cdahlqvist looks good! but, I am having trouble having the whole test-suite pass... your tests pass. other tests pass. but when I run it all together, things fail. I am trying to debug it. once that is resolved, I will merge this in! |
so
|
in the lines above. the mocked actions need to be updated to include the for example:
should be updated to:
same goes for |
Hi, When is going to be available to use it? |
@talevy Have added the routing parameter. |
cool! tests are looking good @cdahlqvist! can you go ahead and update your master from remote and |
@talevy Done. |
Thank you! LGTM |
Added support for routing parameters.
Does this currently work for UPDATES in the downloadable or YUM versions of logstash? I'm using logstash-1.4.2-1_2c0f5a1.noarch I'm having issues with updating parent/child documents. I can't seem to add any routing information when doing an UPDATE action. I keep getting :message=>"Unknown setting 'routing' for elasticsearch", :level=>:error} I've also tried logstash-1.5.0.rc2-1.noarch and same message. I'm new to logstash/elasticsearch so forgive me if this is obvious. |
@crickeys we are still focusing on cleaning up a few pipeline details for another RC3 release in the next week or 2. so it will be in there. For now, this feature is only compatible with development master of Logstash |
I have added support for routing when indexing documents.