You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
636 B
24 lines
636 B
import splunk.Intersplunk as si
|
|
import time
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
try:
|
|
keywords,options = si.getKeywordsAndOptions()
|
|
results,dumb1, dumb2 = si.getOrganizedResults()
|
|
|
|
now = time.time()
|
|
# for each result
|
|
for result in results:
|
|
keys = []
|
|
for key in result:
|
|
if (result[key]) :
|
|
keys.append(key)
|
|
keys.sort()
|
|
result['fieldnames'] = ",".join(keys)
|
|
si.outputResults(results)
|
|
|
|
except Exception as e:
|
|
si.generateErrorResults("Error occurred while running the custom command: '%s'" % str(e))
|