diff --git a/CHANGES.md b/CHANGES.md index 53c7886..b3fcafc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Change Log +## 2.2.0 + +- Add `count` parameter to Oneshot search + ## 2.1.2 - Added action to generate or get a HEC token diff --git a/actions/search.py b/actions/search.py index 74ac7cb..ee7f627 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): + def run(self, instance, query, count): """stackstorm run method""" # Find config details if instance: @@ -52,7 +52,7 @@ def run(self, instance, query): "Failed to connect to Splunk Instance {} with error {}".format(splunk_config, err) ) - result = self.service.jobs.oneshot(query, params={"output_mode": "json"}) + result = self.service.jobs.oneshot(query, params={"output_mode": "json", "count": count}) reader = results.ResultsReader(result) search_results = [] diff --git a/actions/search.yaml b/actions/search.yaml index 2862005..1310cc7 100644 --- a/actions/search.yaml +++ b/actions/search.yaml @@ -14,3 +14,9 @@ parameters: description: "Search query (e.g. 'search * | head 10')" required: true position: 1 + count: + type: integer + description: "The maximum number of items to return" + required: true + position: 2 + default: 100 diff --git a/pack.yaml b/pack.yaml index 3965df3..0bd46ad 100644 --- a/pack.yaml +++ b/pack.yaml @@ -6,7 +6,7 @@ keywords: - splunk - monitoring - alerting -version: 2.1.2 +version: 2.2.0 author : StackStorm, Inc. email : info@stackstorm.com python_versions: