diff --git a/CHANGES.md b/CHANGES.md index b3fcafc..1d716e2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,10 @@ # Change Log +## 2.3.0 + +- Refactor params for Oneshot search +- Change ResultReader to JSONResultReader to fix the ResultsReader deprecated function. + ## 2.2.0 - Add `count` parameter to Oneshot search diff --git a/actions/search.py b/actions/search.py index ee7f627..ce765de 100644 --- a/actions/search.py +++ b/actions/search.py @@ -23,7 +23,7 @@ def __init__(self, config): else: raise ValueError("No Splunk configuration details found") - def run(self, instance, query, count): + def run(self, instance, query, count, offset): """stackstorm run method""" # Find config details if instance: @@ -52,8 +52,8 @@ def run(self, instance, query, count): "Failed to connect to Splunk Instance {} with error {}".format(splunk_config, err) ) - result = self.service.jobs.oneshot(query, params={"output_mode": "json", "count": count}) - reader = results.ResultsReader(result) + result = self.service.jobs.oneshot(query, count=count, offset=offset, output_mode='json') + reader = results.JSONResultsReader(result) search_results = [] for item in reader: diff --git a/actions/search.yaml b/actions/search.yaml index 1310cc7..1f60a96 100644 --- a/actions/search.yaml +++ b/actions/search.yaml @@ -20,3 +20,9 @@ parameters: required: true position: 2 default: 100 + offset: + type: integer + description: "A number that specifies the index of the first entity to return" + required: true + position: 3 + default: 0 diff --git a/pack.yaml b/pack.yaml index 0bd46ad..38c131a 100644 --- a/pack.yaml +++ b/pack.yaml @@ -6,7 +6,7 @@ keywords: - splunk - monitoring - alerting -version: 2.2.0 +version: 2.3.0 author : StackStorm, Inc. email : info@stackstorm.com python_versions: