splunk-sdk-ruby 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/CHANGELOG.md +160 -0
  2. data/Gemfile +8 -0
  3. data/LICENSE +177 -0
  4. data/README.md +310 -0
  5. data/Rakefile +40 -0
  6. data/examples/1_connect.rb +51 -0
  7. data/examples/2_manage.rb +103 -0
  8. data/examples/3_blocking_searches.rb +82 -0
  9. data/examples/4_asynchronous_searches.rb +79 -0
  10. data/examples/5_stream_data_to_splunk.rb +79 -0
  11. data/lib/splunk-sdk-ruby.rb +47 -0
  12. data/lib/splunk-sdk-ruby/ambiguous_entity_reference.rb +28 -0
  13. data/lib/splunk-sdk-ruby/atomfeed.rb +323 -0
  14. data/lib/splunk-sdk-ruby/collection.rb +417 -0
  15. data/lib/splunk-sdk-ruby/collection/apps.rb +35 -0
  16. data/lib/splunk-sdk-ruby/collection/case_insensitive_collection.rb +58 -0
  17. data/lib/splunk-sdk-ruby/collection/configuration_file.rb +50 -0
  18. data/lib/splunk-sdk-ruby/collection/configurations.rb +80 -0
  19. data/lib/splunk-sdk-ruby/collection/jobs.rb +136 -0
  20. data/lib/splunk-sdk-ruby/collection/messages.rb +51 -0
  21. data/lib/splunk-sdk-ruby/context.rb +522 -0
  22. data/lib/splunk-sdk-ruby/entity.rb +260 -0
  23. data/lib/splunk-sdk-ruby/entity/index.rb +191 -0
  24. data/lib/splunk-sdk-ruby/entity/job.rb +339 -0
  25. data/lib/splunk-sdk-ruby/entity/message.rb +36 -0
  26. data/lib/splunk-sdk-ruby/entity/saved_search.rb +71 -0
  27. data/lib/splunk-sdk-ruby/entity/stanza.rb +45 -0
  28. data/lib/splunk-sdk-ruby/entity_not_ready.rb +26 -0
  29. data/lib/splunk-sdk-ruby/illegal_operation.rb +27 -0
  30. data/lib/splunk-sdk-ruby/namespace.rb +239 -0
  31. data/lib/splunk-sdk-ruby/resultsreader.rb +716 -0
  32. data/lib/splunk-sdk-ruby/service.rb +339 -0
  33. data/lib/splunk-sdk-ruby/splunk_http_error.rb +49 -0
  34. data/lib/splunk-sdk-ruby/synonyms.rb +50 -0
  35. data/lib/splunk-sdk-ruby/version.rb +27 -0
  36. data/lib/splunk-sdk-ruby/xml_shim.rb +117 -0
  37. data/splunk-sdk-ruby.gemspec +27 -0
  38. data/test/atom_test_data.rb +472 -0
  39. data/test/data/atom/atom_feed_with_message.xml +19 -0
  40. data/test/data/atom/atom_with_feed.xml +99 -0
  41. data/test/data/atom/atom_with_several_entries.xml +101 -0
  42. data/test/data/atom/atom_with_simple_entries.xml +30 -0
  43. data/test/data/atom/atom_without_feed.xml +248 -0
  44. data/test/data/export/4.2.5/export_results.xml +88 -0
  45. data/test/data/export/4.3.5/export_results.xml +87 -0
  46. data/test/data/export/5.0.1/export_results.xml +78 -0
  47. data/test/data/export/5.0.1/nonreporting.xml +232 -0
  48. data/test/data/results/4.2.5/results-empty.xml +0 -0
  49. data/test/data/results/4.2.5/results-preview.xml +255 -0
  50. data/test/data/results/4.2.5/results.xml +336 -0
  51. data/test/data/results/4.3.5/results-empty.xml +0 -0
  52. data/test/data/results/4.3.5/results-preview.xml +1057 -0
  53. data/test/data/results/4.3.5/results.xml +626 -0
  54. data/test/data/results/5.0.2/results-empty.xml +1 -0
  55. data/test/data/results/5.0.2/results-empty_preview.xml +1 -0
  56. data/test/data/results/5.0.2/results-preview.xml +448 -0
  57. data/test/data/results/5.0.2/results.xml +501 -0
  58. data/test/export_test_data.json +360 -0
  59. data/test/resultsreader_test_data.json +1119 -0
  60. data/test/services.server.info.xml +43 -0
  61. data/test/services.xml +111 -0
  62. data/test/test_atomfeed.rb +71 -0
  63. data/test/test_collection.rb +278 -0
  64. data/test/test_configuration_file.rb +124 -0
  65. data/test/test_context.rb +119 -0
  66. data/test/test_entity.rb +95 -0
  67. data/test/test_helper.rb +250 -0
  68. data/test/test_http_error.rb +52 -0
  69. data/test/test_index.rb +91 -0
  70. data/test/test_jobs.rb +319 -0
  71. data/test/test_messages.rb +17 -0
  72. data/test/test_namespace.rb +188 -0
  73. data/test/test_restarts.rb +49 -0
  74. data/test/test_resultsreader.rb +106 -0
  75. data/test/test_roles.rb +41 -0
  76. data/test/test_saved_searches.rb +119 -0
  77. data/test/test_service.rb +65 -0
  78. data/test/test_users.rb +33 -0
  79. data/test/test_xml_shim.rb +28 -0
  80. data/test/testfile.txt +1 -0
  81. metadata +200 -0
@@ -0,0 +1 @@
1
+ <results preview='0'/>
@@ -0,0 +1 @@
1
+ <results preview='1'/>
@@ -0,0 +1,448 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <results preview='1'>
3
+ <meta>
4
+ <fieldOrder>
5
+ <field>_bkt</field>
6
+ <field>_cd</field>
7
+ <field>_confstr</field>
8
+ <field>_indextime</field>
9
+ <field>_kv</field>
10
+ <field>_raw</field>
11
+ <field>_serial</field>
12
+ <field>_si</field>
13
+ <field>_sourcetype</field>
14
+ <field>_subsecond</field>
15
+ <field>_time</field>
16
+ <field>abandoned_channels</field>
17
+ <field>active_hist_searches</field>
18
+ <field>active_realtime_searches</field>
19
+ <field>app</field>
20
+ <field>appCodeName</field>
21
+ <field>appName</field>
22
+ <field>appVersion</field>
23
+ <field>average_kbps</field>
24
+ <field>avg_age</field>
25
+ <field>browser</field>
26
+ <field>bytes</field>
27
+ <field>chillOrFreeze</field>
28
+ <field>class</field>
29
+ <field>client_app</field>
30
+ <field>clientip</field>
31
+ <field>component</field>
32
+ <field>count</field>
33
+ <field>current_size</field>
34
+ <field>current_size_kb</field>
35
+ <field>date_hour</field>
36
+ <field>date_mday</field>
37
+ <field>date_minute</field>
38
+ <field>date_month</field>
39
+ <field>date_second</field>
40
+ <field>date_wday</field>
41
+ <field>date_year</field>
42
+ <field>date_zone</field>
43
+ <field>delimiter</field>
44
+ <field>digest</field>
45
+ <field>dispatched</field>
46
+ <field>display_row_numbers</field>
47
+ <field>drop_count</field>
48
+ <field>earliest</field>
49
+ <field>enable_event_actions</field>
50
+ <field>enable_field_actions</field>
51
+ <field>entity_name</field>
52
+ <field>eps</field>
53
+ <field>ev</field>
54
+ <field>eventtype</field>
55
+ <field>field_list</field>
56
+ <field>fields</field>
57
+ <field>file</field>
58
+ <field>fillcontents</field>
59
+ <field>flushBlockSig</field>
60
+ <field>fork_recovermetadata</field>
61
+ <field>group</field>
62
+ <field>host</field>
63
+ <field>ident</field>
64
+ <field>inactive_channels</field>
65
+ <field>index</field>
66
+ <field>instantaneous_eps</field>
67
+ <field>instantaneous_kbps</field>
68
+ <field>jobStatus</field>
69
+ <field>kb</field>
70
+ <field>kbps</field>
71
+ <field>largest_size</field>
72
+ <field>latest</field>
73
+ <field>line</field>
74
+ <field>linecount</field>
75
+ <field>load_average</field>
76
+ <field>log_level</field>
77
+ <field>max_age</field>
78
+ <field>max_lines</field>
79
+ <field>max_lines_constraint</field>
80
+ <field>max_size_kb</field>
81
+ <field>message</field>
82
+ <field>message_level</field>
83
+ <field>method</field>
84
+ <field>min_freq</field>
85
+ <field>min_lines</field>
86
+ <field>name</field>
87
+ <field>namespace</field>
88
+ <field>new_channels</field>
89
+ <field>numMsgs</field>
90
+ <field>offset</field>
91
+ <field>other</field>
92
+ <field>output_mode</field>
93
+ <field>output_time_format</field>
94
+ <field>platform</field>
95
+ <field>punct</field>
96
+ <field>q</field>
97
+ <field>qsize</field>
98
+ <field>qwork_units</field>
99
+ <field>rebuild_metadata</field>
100
+ <field>reclaimed_channels</field>
101
+ <field>referer</field>
102
+ <field>referer_domain</field>
103
+ <field>refresh</field>
104
+ <field>removed_channels</field>
105
+ <field>replicate_semislice</field>
106
+ <field>req_time</field>
107
+ <field>requestid</field>
108
+ <field>retryMove_1hotBkt</field>
109
+ <field>reverse_order</field>
110
+ <field>roll_hotBkt</field>
111
+ <field>root</field>
112
+ <field>s</field>
113
+ <field>search</field>
114
+ <field>segmentation</field>
115
+ <field>series</field>
116
+ <field>service_externProc</field>
117
+ <field>service_maxSizes</field>
118
+ <field>service_volumes</field>
119
+ <field>show_empty_fields</field>
120
+ <field>sid</field>
121
+ <field>size_hotBkt</field>
122
+ <field>skipped</field>
123
+ <field>smallest_size</field>
124
+ <field>sortDir</field>
125
+ <field>sortKey</field>
126
+ <field>sort_dir</field>
127
+ <field>sort_key</field>
128
+ <field>source</field>
129
+ <field>sourcetype</field>
130
+ <field>spent</field>
131
+ <field>splunk_server</field>
132
+ <field>staticFields</field>
133
+ <field>status</field>
134
+ <field>sync_hotBkt</field>
135
+ <field>task</field>
136
+ <field>templateTime</field>
137
+ <field>throttle_optimize</field>
138
+ <field>time_format</field>
139
+ <field>timedout_channels</field>
140
+ <field>timeendpos</field>
141
+ <field>timestamp</field>
142
+ <field>timestartpos</field>
143
+ <field>total_k_processed</field>
144
+ <field>truncation_mode</field>
145
+ <field>update_bktManifest</field>
146
+ <field>update_checksums</field>
147
+ <field>uri</field>
148
+ <field>uri_path</field>
149
+ <field>uri_query</field>
150
+ <field>user</field>
151
+ <field>userAgent</field>
152
+ <field>useragent</field>
153
+ <field>version</field>
154
+ <field>viewTime</field>
155
+ <field>wait</field>
156
+ <field>with_new</field>
157
+ <field>workers</field>
158
+ </fieldOrder>
159
+ </meta>
160
+ <result offset='0'>
161
+ <field k='_bkt'>
162
+ <value><text>_internal~20~D8F318D9-5D7F-43B5-911F-9821FBAEEA9B</text></value>
163
+ </field>
164
+ <field k='_cd'>
165
+ <value><text>20:6362329</text></value>
166
+ </field>
167
+ <field k='_indextime'>
168
+ <value><text>1355942859</text></value>
169
+ </field>
170
+ <field k='_kv'>
171
+ <value><text>1</text></value>
172
+ </field>
173
+ <field k='_raw'><v xml:space='preserve' trunc='0'>12-19-2012 10:47:39.098 -0800 INFO Metrics - group=mpool, max_used_interval=11760, max_used=106926, avg_rsv=256, capacity=536870912, used=0, rep_used=0</v></field>
174
+ <field k='_serial'>
175
+ <value><text>20446</text></value>
176
+ </field>
177
+ <field k='_si'>
178
+ <value><text>fross-mbp15.local</text></value>
179
+ <value><text>_internal</text></value>
180
+ </field>
181
+ <field k='_sourcetype'>
182
+ <value><text>splunkd</text></value>
183
+ </field>
184
+ <field k='_subsecond'>
185
+ <value><text>.098</text></value>
186
+ </field>
187
+ <field k='_time'>
188
+ <value><text>2012-12-19T10:47:39.098-08:00</text></value>
189
+ </field>
190
+ <field k='component'>
191
+ <value><text>Metrics</text></value>
192
+ </field>
193
+ <field k='date_hour'>
194
+ <value><text>10</text></value>
195
+ </field>
196
+ <field k='date_mday'>
197
+ <value><text>19</text></value>
198
+ </field>
199
+ <field k='date_minute'>
200
+ <value><text>47</text></value>
201
+ </field>
202
+ <field k='date_month'>
203
+ <value><text>december</text></value>
204
+ </field>
205
+ <field k='date_second'>
206
+ <value><text>39</text></value>
207
+ </field>
208
+ <field k='date_wday'>
209
+ <value><text>wednesday</text></value>
210
+ </field>
211
+ <field k='date_year'>
212
+ <value><text>2012</text></value>
213
+ </field>
214
+ <field k='date_zone'>
215
+ <value><text>-480</text></value>
216
+ </field>
217
+ <field k='group'>
218
+ <value><text>mpool</text></value>
219
+ </field>
220
+ <field k='host'>
221
+ <value><text>fross-mbp15.local</text></value>
222
+ </field>
223
+ <field k='index'>
224
+ <value h='1'><text>_internal</text></value>
225
+ </field>
226
+ <field k='linecount'>
227
+ <value><text>1</text></value>
228
+ </field>
229
+ <field k='log_level'>
230
+ <value><text>INFO</text></value>
231
+ </field>
232
+ <field k='message'>
233
+ <value><text>group=mpool, max_used_interval=11760, max_used=106926, avg_rsv=256, capacity=536870912, used=0, rep_used=0</text></value>
234
+ </field>
235
+ <field k='punct'>
236
+ <value><text>--_::._-____-_=,_=,_=,_=,_=,_=,_=</text></value>
237
+ </field>
238
+ <field k='source'>
239
+ <value><text>/Users/fross/splunks/splunk-5.0.2/var/log/splunk/metrics.log</text></value>
240
+ </field>
241
+ <field k='sourcetype'>
242
+ <value><text>splunkd</text></value>
243
+ </field>
244
+ <field k='splunk_server'>
245
+ <value><text>fross-mbp15.local</text></value>
246
+ </field>
247
+ <field k='timeendpos'>
248
+ <value><text>29</text></value>
249
+ </field>
250
+ <field k='timestartpos'>
251
+ <value><text>0</text></value>
252
+ </field>
253
+ </result>
254
+ <result offset='1'>
255
+ <field k='_bkt'>
256
+ <value><text>_internal~20~D8F318D9-5D7F-43B5-911F-9821FBAEEA9B</text></value>
257
+ </field>
258
+ <field k='_cd'>
259
+ <value><text>20:6362402</text></value>
260
+ </field>
261
+ <field k='_indextime'>
262
+ <value><text>1355942859</text></value>
263
+ </field>
264
+ <field k='_kv'>
265
+ <value><text>1</text></value>
266
+ </field>
267
+ <field k='_raw'><v xml:space='preserve' trunc='0'>12-19-2012 10:47:39.099 -0800 INFO Metrics - group=pipeline, name=merging, processor=sendout, cpu_seconds=0.000000, executes=48, cumulative_hits=927340</v></field>
268
+ <field k='_serial'>
269
+ <value><text>20436</text></value>
270
+ </field>
271
+ <field k='_si'>
272
+ <value><text>fross-mbp15.local</text></value>
273
+ <value><text>_internal</text></value>
274
+ </field>
275
+ <field k='_sourcetype'>
276
+ <value><text>splunkd</text></value>
277
+ </field>
278
+ <field k='_subsecond'>
279
+ <value><text>.099</text></value>
280
+ </field>
281
+ <field k='_time'>
282
+ <value><text>2012-12-19T10:47:39.099-08:00</text></value>
283
+ </field>
284
+ <field k='component'>
285
+ <value><text>Metrics</text></value>
286
+ </field>
287
+ <field k='date_hour'>
288
+ <value><text>10</text></value>
289
+ </field>
290
+ <field k='date_mday'>
291
+ <value><text>19</text></value>
292
+ </field>
293
+ <field k='date_minute'>
294
+ <value><text>47</text></value>
295
+ </field>
296
+ <field k='date_month'>
297
+ <value><text>december</text></value>
298
+ </field>
299
+ <field k='date_second'>
300
+ <value><text>39</text></value>
301
+ </field>
302
+ <field k='date_wday'>
303
+ <value><text>wednesday</text></value>
304
+ </field>
305
+ <field k='date_year'>
306
+ <value><text>2012</text></value>
307
+ </field>
308
+ <field k='date_zone'>
309
+ <value><text>-480</text></value>
310
+ </field>
311
+ <field k='group'>
312
+ <value><text>pipeline</text></value>
313
+ </field>
314
+ <field k='host'>
315
+ <value><text>fross-mbp15.local</text></value>
316
+ </field>
317
+ <field k='index'>
318
+ <value h='1'><text>_internal</text></value>
319
+ </field>
320
+ <field k='linecount'>
321
+ <value><text>1</text></value>
322
+ </field>
323
+ <field k='log_level'>
324
+ <value><text>INFO</text></value>
325
+ </field>
326
+ <field k='message'>
327
+ <value><text>group=pipeline, name=merging, processor=sendout, cpu_seconds=0.000000, executes=48, cumulative_hits=927340</text></value>
328
+ </field>
329
+ <field k='name'>
330
+ <value><text>merging</text></value>
331
+ </field>
332
+ <field k='punct'>
333
+ <value><text>--_::._-____-_=,_=,_=,_=.,_=,_=</text></value>
334
+ </field>
335
+ <field k='source'>
336
+ <value><text>/Users/fross/splunks/splunk-5.0.2/var/log/splunk/metrics.log</text></value>
337
+ </field>
338
+ <field k='sourcetype'>
339
+ <value><text>splunkd</text></value>
340
+ </field>
341
+ <field k='splunk_server'>
342
+ <value><text>fross-mbp15.local</text></value>
343
+ </field>
344
+ <field k='timeendpos'>
345
+ <value><text>29</text></value>
346
+ </field>
347
+ <field k='timestartpos'>
348
+ <value><text>0</text></value>
349
+ </field>
350
+ </result>
351
+ <result offset='2'>
352
+ <field k='_bkt'>
353
+ <value><text>_internal~20~D8F318D9-5D7F-43B5-911F-9821FBAEEA9B</text></value>
354
+ </field>
355
+ <field k='_cd'>
356
+ <value><text>20:6362395</text></value>
357
+ </field>
358
+ <field k='_indextime'>
359
+ <value><text>1355942859</text></value>
360
+ </field>
361
+ <field k='_kv'>
362
+ <value><text>1</text></value>
363
+ </field>
364
+ <field k='_raw'><v xml:space='preserve' trunc='0'>12-19-2012 10:47:39.099 -0800 INFO Metrics - group=pipeline, name=merging, processor=readerin, cpu_seconds=0.000000, executes=48, cumulative_hits=927707</v></field>
365
+ <field k='_serial'>
366
+ <value><text>20437</text></value>
367
+ </field>
368
+ <field k='_si'>
369
+ <value><text>fross-mbp15.local</text></value>
370
+ <value><text>_internal</text></value>
371
+ </field>
372
+ <field k='_sourcetype'>
373
+ <value><text>splunkd</text></value>
374
+ </field>
375
+ <field k='_subsecond'>
376
+ <value><text>.099</text></value>
377
+ </field>
378
+ <field k='_time'>
379
+ <value><text>2012-12-19T10:47:39.099-08:00</text></value>
380
+ </field>
381
+ <field k='component'>
382
+ <value><text>Metrics</text></value>
383
+ </field>
384
+ <field k='date_hour'>
385
+ <value><text>10</text></value>
386
+ </field>
387
+ <field k='date_mday'>
388
+ <value><text>19</text></value>
389
+ </field>
390
+ <field k='date_minute'>
391
+ <value><text>47</text></value>
392
+ </field>
393
+ <field k='date_month'>
394
+ <value><text>december</text></value>
395
+ </field>
396
+ <field k='date_second'>
397
+ <value><text>39</text></value>
398
+ </field>
399
+ <field k='date_wday'>
400
+ <value><text>wednesday</text></value>
401
+ </field>
402
+ <field k='date_year'>
403
+ <value><text>2012</text></value>
404
+ </field>
405
+ <field k='date_zone'>
406
+ <value><text>-480</text></value>
407
+ </field>
408
+ <field k='group'>
409
+ <value><text>pipeline</text></value>
410
+ </field>
411
+ <field k='host'>
412
+ <value><text>fross-mbp15.local</text></value>
413
+ </field>
414
+ <field k='index'>
415
+ <value h='1'><text>_internal</text></value>
416
+ </field>
417
+ <field k='linecount'>
418
+ <value><text>1</text></value>
419
+ </field>
420
+ <field k='log_level'>
421
+ <value><text>INFO</text></value>
422
+ </field>
423
+ <field k='message'>
424
+ <value><text>group=pipeline, name=merging, processor=readerin, cpu_seconds=0.000000, executes=48, cumulative_hits=927707</text></value>
425
+ </field>
426
+ <field k='name'>
427
+ <value><text>merging</text></value>
428
+ </field>
429
+ <field k='punct'>
430
+ <value><text>--_::._-____-_=,_=,_=,_=.,_=,_=</text></value>
431
+ </field>
432
+ <field k='source'>
433
+ <value><text>/Users/fross/splunks/splunk-5.0.2/var/log/splunk/metrics.log</text></value>
434
+ </field>
435
+ <field k='sourcetype'>
436
+ <value><text>splunkd</text></value>
437
+ </field>
438
+ <field k='splunk_server'>
439
+ <value><text>fross-mbp15.local</text></value>
440
+ </field>
441
+ <field k='timeendpos'>
442
+ <value><text>29</text></value>
443
+ </field>
444
+ <field k='timestartpos'>
445
+ <value><text>0</text></value>
446
+ </field>
447
+ </result>
448
+ </results>