-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add enhancement script for splunk search * add to indicator types SplunkSearchPy * use cmd only in depnds on
- Loading branch information
Showing
2 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
commonfields: | ||
id: SplunkPySearch | ||
version: -1 | ||
name: SplunkPySearch | ||
script: |- | ||
query = demisto.args()['query'] | ||
rows = demisto.args()['rows'] | ||
query = query + ' | head ' + rows | ||
res = demisto.executeCommand('splunk-search',{'using-brand': 'splunkpy', 'query': query}) | ||
if (res and len(res)>0 and res[0]['Contents']): | ||
demisto.results({"Type": 1, "Contents": res[0]['Contents'], "ContentsFormat": "json", "EntryContext": {}, | ||
"HumanReadable": tableToMarkdown("Splunk Search results for: " + query, res[0]['Contents'], "")}) | ||
else: | ||
demisto.results('No results.') | ||
type: python | ||
tags: | ||
- enhancement | ||
- splunk | ||
comment: Run a query through Splunk and format the results as a table | ||
enabled: true | ||
args: | ||
- name: query | ||
required: true | ||
default: true | ||
description: Splunk query to execute | ||
- name: rows | ||
description: Return up to X first rows. If omitted, defaults to 10. | ||
defaultValue: "10" | ||
scripttarget: 0 | ||
dependson: | ||
must: | ||
- splunk-search |