You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Run a search and immediately start streaming preview events.
1425
+
1426
+
Returns an InputStream over the events. The InputStream
1427
+
streams XML fragments from the server. The SDK provides
1428
+
``results.ResultsReader`` to lazily parse this stream into
1429
+
usable Python objects. For example::
1430
+
1431
+
import splunklib.client as client
1432
+
import splunklib.results as results
1433
+
s = client.connect(...)
1434
+
r = results.ResultsReader(s.jobs.export("search * | head 5"))
1435
+
assert r.is_preview == False # The job is finished when we get here
1436
+
for kind, event in r:
1437
+
assert kind == 'RESULT'
1438
+
# events are returned as dicts with strings as values.
1439
+
print event
1440
+
1441
+
``export`` makes a single roundtrip to the server (as opposed
1442
+
to two for create followed by preview), plus at most two more
1443
+
if autologin is turned on.
1444
+
1445
+
:raises SyntaxError: on invalid queries.
1446
+
1447
+
:param query: Splunk search language query to run
1448
+
:type query: ``str``
1449
+
:param params: Additional arguments to export (see the `REST API docs <http://docs/Documentation/Splunk/4.3.2/RESTAPI/RESTsearch#search.2Fjobs.2Fexport>`_).
1450
+
:returns: InputStream over raw XML returned from the server.
1451
+
"""
1452
+
if"exec_mode"inparams:
1453
+
raiseTypeError("Cannot specify an exec_mode to export.")
0 commit comments