splunk / splunk-sdk-ruby

Splunk Software Development Kit for Ruby
http://dev.splunk.com
Apache License 2.0
36 stars 21 forks source link

Convert to Nokogiri, clean up, and add dependencies for JRuby #12

Closed dominiquebrezinski closed 11 years ago

dominiquebrezinski commented 11 years ago

Converted to use Nokogiri instead of LibXML, because it is better ;) and supports JRuby as well. Fixed a number of broken tests that didn't honor .splunkrc settings, and converted some code to idiomatic ruby along the way.

itay commented 11 years ago

@dominiquebrezinski a couple of questions:

  1. You have the VERSION file that you added, but you're not using it. Is that on purpose?
  2. When we make the SDK public as a "preview", the version will be 0.1.0, so we should probably change the version to that. I realize the original SDK had it at 1.0, which was a mistake on our part :)

@benwoody, @beezly any thoughts on the checkin?

dominiquebrezinski commented 11 years ago

Oops, yeah that version file can go away. The gemspec file needs some help. The file include for the existing version.rb and the Splunk::VERSION doesn't play nice in several use cases where the gem is repackaged. One example is using Redstorm to build and deploy Backtype Storm topologies on JRuby.

Feel free to fix the versioning to what works for you, or I can do it and submit another pull request.

I have some questions about streaming search results from /search/jobs/export. The current implementation of Splunk::Jobs.create_stream is fubar'ed for a bunch of reasons, and it does not work at all for me. In jruby it actually hangs indefinitely until the network connection is killed. I am working on a re-implementation that includes:

However, when I make a valid request for a realtime search to /search/jobs/export I get back a 200 but the body is empty, and I never receive any chunked results. Nor do I receive any data at all. I have waited for minutes and see nothing. I validated that I get results for the same search issued as a synchronous search, and that I am creating new events that would be picked up by the rt search. What am I missing? Is there a bug or something very tricky about that request?

You can respond to dbrez@amazon or call me at 206 266 0406.

Thanks!

On Thu, Oct 18, 2012 at 12:27 PM, Itay Neeman notifications@github.comwrote:

@dominiquebrezinski https://github.com/dominiquebrezinski a couple of questions:

  1. You have the VERSION file that you added, but you're not using it. Is that on purpose?
  2. When we make the SDK public as a "preview", the version will be 0.1.0, so we should probably change the version to that. I realize the original SDK had it at 1.0, which was a mistake on our part :)

@benwoody https://github.com/benwoody, @beezlyhttps://github.com/beezlyany thoughts on the checkin?

— Reply to this email directly or view it on GitHubhttps://github.com/splunk/splunk-sdk-ruby/pull/12#issuecomment-9578947.

beezly commented 11 years ago

Nokogiri rather than LibXML seems like a good choice.

dominiquebrezinski commented 11 years ago

OK, this pull request is in good shape now. create_stream is working well. I confirmed everything works against 4.3.4. Streaming results are broken in 4.3.2, but that is a server-side problem. There is still more work that can be done to rubyify the remaining code and interfaces, but functionally the code is working well now.

I have tested on MRI 1.9.3 and JRuby 1.6.7 using the gem with rvm and as part of a twitter storm/RedStorm topology, which bundles the gems into a jar. The gemspec at least works under all these use-cases now.

itay commented 11 years ago

@dominiquebrezinski excellent, thank you! We're going to run some tests here, and then we can merge.

Also, have you signed our contributors agreement? :)

http://dev.splunk.com/goto/individualcontributions

neerajluthra commented 11 years ago

Received the agreement and changes look good ... tests pass as well. I will merge the pull request shortly.