splunk-client 0.6 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +19 -6
- data/VERSION +1 -1
- data/lib/splunk_client/splunk_result.rb +1 -1
- data/lib/splunk_client/splunk_results.rb +1 -1
- metadata +94 -86
    
        data/README.md
    CHANGED
    
    | @@ -2,6 +2,12 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            Ruby library for dealing with Splunk searches and results using the Splunk REST API.
         | 
| 4 4 |  | 
| 5 | 
            +
            ## Features
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            * Session based authentication to Splunk REST interface
         | 
| 8 | 
            +
            * Create and check on the status of Splunk Jobs
         | 
| 9 | 
            +
            * Natural Ruby methods for interacting with search results (no need to parse XML or JSON or use Ruby Hashes)
         | 
| 10 | 
            +
             | 
| 5 11 | 
             
            ## Installation
         | 
| 6 12 |  | 
| 7 13 | 
             
            	gem install splunk-client
         | 
| @@ -10,7 +16,8 @@ Ruby library for dealing with Splunk searches and results using the Splunk REST | |
| 10 16 |  | 
| 11 17 | 
             
            Creating and using a client is easy:
         | 
| 12 18 |  | 
| 13 | 
            -
            	require ' | 
| 19 | 
            +
            	require 'rubygems' 
         | 
| 20 | 
            +
            	require 'splunk-client'
         | 
| 14 21 |  | 
| 15 22 | 
             
            	# Create the client
         | 
| 16 23 | 
             
            	splunk = SplunkClient.new("username", "password", "hostname")
         | 
| @@ -24,7 +31,7 @@ Creating and using a client is easy: | |
| 24 31 | 
             
            	#Print the raw XML results 
         | 
| 25 32 | 
             
            	puts search.results
         | 
| 26 33 |  | 
| 27 | 
            -
            	# | 
| 34 | 
            +
            	# Use ruby methods for dealing with results:
         | 
| 28 35 | 
             
            	search.parsedResults.each do |result|
         | 
| 29 36 | 
             
            		puts result.host + " : " + result.time
         | 
| 30 37 | 
             
            	end
         | 
| @@ -35,16 +42,22 @@ Creating and using a client is easy: | |
| 35 42 |  | 
| 36 43 | 
             
            * Looking for more or less results? Use `search.results(maxResults)` to control how much is returned. (A value of 0 returns all results (this is the default.))
         | 
| 37 44 |  | 
| 38 | 
            -
            * Access Splunk fields in results via method calls | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 45 | 
            +
            * Access Splunk fields in results via simple method calls
         | 
| 46 | 
            +
             | 
| 47 | 
            +
                  `result = search.parsedResults`
         | 
| 48 | 
            +
                  `puts result[0].fieldName`
         | 
| 49 | 
            +
             | 
| 41 50 |  | 
| 42 51 | 
             
            ## Revision History
         | 
| 43 52 |  | 
| 44 53 | 
             
            #### 0.6
         | 
| 45 54 | 
             
            * Added two new objects: SplunkResults and SplunkResult for to support:
         | 
| 46 55 | 
             
            * Accessing Splunk fields via method calls
         | 
| 47 | 
            -
             | 
| 56 | 
            +
             | 
| 57 | 
            +
                
         | 
| 58 | 
            +
                  `search.parsedResults.each {|result| puts result.$$FIELD_NAME$$}`
         | 
| 59 | 
            +
             | 
| 60 | 
            +
             | 
| 48 61 |  | 
| 49 62 | 
             
            #### 0.5
         | 
| 50 63 | 
             
            WARNING: Compatibility with prior versions will break as SplunkClient no longer returns a sid. It now returns a SplunkJob object.
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0.6
         | 
| 1 | 
            +
            0.6.1
         | 
| @@ -14,7 +14,7 @@ class SplunkResult | |
| 14 14 | 
             
                @result.field("[@k=\"_time\"]").value.text
         | 
| 15 15 | 
             
              end
         | 
| 16 16 |  | 
| 17 | 
            -
              # Ex: splunkResult.sourceIp => nokogiriNode. | 
| 17 | 
            +
              # Ex: splunkResult.sourceIp => nokogiriNode.field("[@k=\"sourceIp\"]").value.text
         | 
| 18 18 | 
             
              def method_missing(name, *args, &blk)
         | 
| 19 19 | 
             
                if args.empty? && blk.nil? && @result.field("[@k=\"#{name}\"]")
         | 
| 20 20 | 
             
                  @result.field("[@k=\"#{name}\"]").value.text
         | 
    
        metadata
    CHANGED
    
    | @@ -1,103 +1,102 @@ | |
| 1 | 
            -
            --- !ruby/object:Gem::Specification
         | 
| 1 | 
            +
            --- !ruby/object:Gem::Specification 
         | 
| 2 2 | 
             
            name: splunk-client
         | 
| 3 | 
            -
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
               | 
| 3 | 
            +
            version: !ruby/object:Gem::Version 
         | 
| 4 | 
            +
              hash: 5
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 | 
            +
              segments: 
         | 
| 7 | 
            +
              - 0
         | 
| 8 | 
            +
              - 6
         | 
| 9 | 
            +
              - 1
         | 
| 10 | 
            +
              version: 0.6.1
         | 
| 6 11 | 
             
            platform: ruby
         | 
| 7 | 
            -
            authors:
         | 
| 12 | 
            +
            authors: 
         | 
| 8 13 | 
             
            - Christopher Brito
         | 
| 9 14 | 
             
            autorequire: 
         | 
| 10 15 | 
             
            bindir: bin
         | 
| 11 16 | 
             
            cert_chain: []
         | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 17 | 
            +
             | 
| 18 | 
            +
            date: 2012-05-20 00:00:00 Z
         | 
| 19 | 
            +
            dependencies: 
         | 
| 20 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 15 21 | 
             
              name: nokogiri
         | 
| 16 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 17 | 
            -
                none: false
         | 
| 18 | 
            -
                requirements:
         | 
| 19 | 
            -
                - - ! '>='
         | 
| 20 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 21 | 
            -
                    version: '0'
         | 
| 22 | 
            -
              type: :runtime
         | 
| 23 22 | 
             
              prerelease: false
         | 
| 24 | 
            -
               | 
| 23 | 
            +
              requirement: &id001 !ruby/object:Gem::Requirement 
         | 
| 25 24 | 
             
                none: false
         | 
| 26 | 
            -
                requirements:
         | 
| 27 | 
            -
                - -  | 
| 28 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 29 | 
            -
                     | 
| 30 | 
            -
             | 
| 25 | 
            +
                requirements: 
         | 
| 26 | 
            +
                - - ">="
         | 
| 27 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 28 | 
            +
                    hash: 3
         | 
| 29 | 
            +
                    segments: 
         | 
| 30 | 
            +
                    - 0
         | 
| 31 | 
            +
                    version: "0"
         | 
| 32 | 
            +
              type: :runtime
         | 
| 33 | 
            +
              version_requirements: *id001
         | 
| 34 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 31 35 | 
             
              name: rake
         | 
| 32 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 33 | 
            -
                none: false
         | 
| 34 | 
            -
                requirements:
         | 
| 35 | 
            -
                - - ! '>='
         | 
| 36 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 37 | 
            -
                    version: '0'
         | 
| 38 | 
            -
              type: :development
         | 
| 39 36 | 
             
              prerelease: false
         | 
| 40 | 
            -
               | 
| 41 | 
            -
                none: false
         | 
| 42 | 
            -
                requirements:
         | 
| 43 | 
            -
                - - ! '>='
         | 
| 44 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 45 | 
            -
                    version: '0'
         | 
| 46 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 47 | 
            -
              name: rspec
         | 
| 48 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 37 | 
            +
              requirement: &id002 !ruby/object:Gem::Requirement 
         | 
| 49 38 | 
             
                none: false
         | 
| 50 | 
            -
                requirements:
         | 
| 51 | 
            -
                - -  | 
| 52 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 53 | 
            -
                     | 
| 39 | 
            +
                requirements: 
         | 
| 40 | 
            +
                - - ">="
         | 
| 41 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 42 | 
            +
                    hash: 3
         | 
| 43 | 
            +
                    segments: 
         | 
| 44 | 
            +
                    - 0
         | 
| 45 | 
            +
                    version: "0"
         | 
| 54 46 | 
             
              type: :development
         | 
| 47 | 
            +
              version_requirements: *id002
         | 
| 48 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 49 | 
            +
              name: rspec
         | 
| 55 50 | 
             
              prerelease: false
         | 
| 56 | 
            -
               | 
| 51 | 
            +
              requirement: &id003 !ruby/object:Gem::Requirement 
         | 
| 57 52 | 
             
                none: false
         | 
| 58 | 
            -
                requirements:
         | 
| 59 | 
            -
                - -  | 
| 60 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                     | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
                none: false
         | 
| 66 | 
            -
                requirements:
         | 
| 67 | 
            -
                - - ! '>='
         | 
| 68 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 69 | 
            -
                    version: '0'
         | 
| 53 | 
            +
                requirements: 
         | 
| 54 | 
            +
                - - ">="
         | 
| 55 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 56 | 
            +
                    hash: 3
         | 
| 57 | 
            +
                    segments: 
         | 
| 58 | 
            +
                    - 0
         | 
| 59 | 
            +
                    version: "0"
         | 
| 70 60 | 
             
              type: :development
         | 
| 61 | 
            +
              version_requirements: *id003
         | 
| 62 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 63 | 
            +
              name: simplecov-rcov
         | 
| 71 64 | 
             
              prerelease: false
         | 
| 72 | 
            -
               | 
| 65 | 
            +
              requirement: &id004 !ruby/object:Gem::Requirement 
         | 
| 73 66 | 
             
                none: false
         | 
| 74 | 
            -
                requirements:
         | 
| 75 | 
            -
                - -  | 
| 76 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 77 | 
            -
                     | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
                none: false
         | 
| 82 | 
            -
                requirements:
         | 
| 83 | 
            -
                - - ! '>='
         | 
| 84 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 85 | 
            -
                    version: '0'
         | 
| 67 | 
            +
                requirements: 
         | 
| 68 | 
            +
                - - ">="
         | 
| 69 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 70 | 
            +
                    hash: 3
         | 
| 71 | 
            +
                    segments: 
         | 
| 72 | 
            +
                    - 0
         | 
| 73 | 
            +
                    version: "0"
         | 
| 86 74 | 
             
              type: :development
         | 
| 75 | 
            +
              version_requirements: *id004
         | 
| 76 | 
            +
            - !ruby/object:Gem::Dependency 
         | 
| 77 | 
            +
              name: json
         | 
| 87 78 | 
             
              prerelease: false
         | 
| 88 | 
            -
               | 
| 79 | 
            +
              requirement: &id005 !ruby/object:Gem::Requirement 
         | 
| 89 80 | 
             
                none: false
         | 
| 90 | 
            -
                requirements:
         | 
| 91 | 
            -
                - -  | 
| 92 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 93 | 
            -
                     | 
| 81 | 
            +
                requirements: 
         | 
| 82 | 
            +
                - - ">="
         | 
| 83 | 
            +
                  - !ruby/object:Gem::Version 
         | 
| 84 | 
            +
                    hash: 3
         | 
| 85 | 
            +
                    segments: 
         | 
| 86 | 
            +
                    - 0
         | 
| 87 | 
            +
                    version: "0"
         | 
| 88 | 
            +
              type: :development
         | 
| 89 | 
            +
              version_requirements: *id005
         | 
| 94 90 | 
             
            description: Simple Ruby library for interfacing with Splunk's REST API.
         | 
| 95 | 
            -
            email:
         | 
| 91 | 
            +
            email: 
         | 
| 96 92 | 
             
            - cbrito@gmail.com
         | 
| 97 93 | 
             
            executables: []
         | 
| 94 | 
            +
             | 
| 98 95 | 
             
            extensions: []
         | 
| 96 | 
            +
             | 
| 99 97 | 
             
            extra_rdoc_files: []
         | 
| 100 | 
            -
             | 
| 98 | 
            +
             | 
| 99 | 
            +
            files: 
         | 
| 101 100 | 
             
            - lib/splunk-client.rb
         | 
| 102 101 | 
             
            - lib/splunk_client/splunk_client.rb
         | 
| 103 102 | 
             
            - lib/splunk_client/splunk_job.rb
         | 
| @@ -112,28 +111,37 @@ files: | |
| 112 111 | 
             
            - Gemfile.lock
         | 
| 113 112 | 
             
            homepage: http://github.com/cbrito/splunk-client
         | 
| 114 113 | 
             
            licenses: []
         | 
| 114 | 
            +
             | 
| 115 115 | 
             
            post_install_message: 
         | 
| 116 116 | 
             
            rdoc_options: []
         | 
| 117 | 
            -
             | 
| 117 | 
            +
             | 
| 118 | 
            +
            require_paths: 
         | 
| 118 119 | 
             
            - lib
         | 
| 119 | 
            -
            required_ruby_version: !ruby/object:Gem::Requirement
         | 
| 120 | 
            +
            required_ruby_version: !ruby/object:Gem::Requirement 
         | 
| 120 121 | 
             
              none: false
         | 
| 121 | 
            -
              requirements:
         | 
| 122 | 
            -
              - -  | 
| 123 | 
            -
                - !ruby/object:Gem::Version
         | 
| 124 | 
            -
                   | 
| 125 | 
            -
             | 
| 122 | 
            +
              requirements: 
         | 
| 123 | 
            +
              - - ">="
         | 
| 124 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 125 | 
            +
                  hash: 3
         | 
| 126 | 
            +
                  segments: 
         | 
| 127 | 
            +
                  - 0
         | 
| 128 | 
            +
                  version: "0"
         | 
| 129 | 
            +
            required_rubygems_version: !ruby/object:Gem::Requirement 
         | 
| 126 130 | 
             
              none: false
         | 
| 127 | 
            -
              requirements:
         | 
| 128 | 
            -
              - -  | 
| 129 | 
            -
                - !ruby/object:Gem::Version
         | 
| 130 | 
            -
                   | 
| 131 | 
            +
              requirements: 
         | 
| 132 | 
            +
              - - ">="
         | 
| 133 | 
            +
                - !ruby/object:Gem::Version 
         | 
| 134 | 
            +
                  hash: 3
         | 
| 135 | 
            +
                  segments: 
         | 
| 136 | 
            +
                  - 0
         | 
| 137 | 
            +
                  version: "0"
         | 
| 131 138 | 
             
            requirements: []
         | 
| 139 | 
            +
             | 
| 132 140 | 
             
            rubyforge_project: 
         | 
| 133 | 
            -
            rubygems_version: 1.8. | 
| 141 | 
            +
            rubygems_version: 1.8.15
         | 
| 134 142 | 
             
            signing_key: 
         | 
| 135 143 | 
             
            specification_version: 3
         | 
| 136 144 | 
             
            summary: Ruby Library for interfacing with Splunk's REST API
         | 
| 137 | 
            -
            test_files:
         | 
| 145 | 
            +
            test_files: 
         | 
| 138 146 | 
             
            - spec/spec_helper.rb
         | 
| 139 147 | 
             
            - spec/splunk_client_spec.rb
         |