File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change 1717"""Tails a realtime search using the export endpoint and prints results to
1818 stdout."""
1919
20- from pprint import pprint
2120import sys
21+ sys .path .insert (0 , '../' )
22+
23+ from pprint import pprint
2224
2325from splunklib .client import connect
24- import splunklib .results as results
26+ from splunklib .results import ResultsReader
2527
2628import utils
2729
@@ -43,13 +45,9 @@ def main():
4345 latest_time = "rt" ,
4446 search_mode = "realtime" )
4547
46- reader = results .ResultsReader (result .body )
47- while True :
48- kind = reader .read ()
49- if kind == None : break
50- if kind == results .RESULT :
51- event = reader .value
52- pprint (event )
48+ for result in ResultsReader (result .body ):
49+ if result is not None :
50+ print pprint (result )
5351
5452 except KeyboardInterrupt :
5553 print "\n Interrupted."
You can’t perform that action at this time.
0 commit comments