mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
3b58b30516
Adding custom functions & playbooks
25 lines
920 B
Python
25 lines
920 B
Python
def string_to_lowercase(input_string=None, **kwargs):
|
|
"""
|
|
Convert the provided string to all lowercase characters
|
|
|
|
Args:
|
|
input_string (CEF type: *): The string to convert to lowercase
|
|
|
|
Returns a JSON-serializable object that implements the configured data paths:
|
|
lowercase_string (CEF type: *): The lowercase string after conversion
|
|
"""
|
|
############################ Custom Code Goes Below This Line #################################
|
|
import json
|
|
import phantom.rules as phantom
|
|
|
|
try:
|
|
lowercase_string = input_string.lower()
|
|
except AttributeError:
|
|
raise ValueError('input_string must be a string or unicode')
|
|
|
|
outputs = {"lowercase_string": lowercase_string}
|
|
|
|
# Return a JSON-serializable object
|
|
assert json.dumps(outputs) # Will raise an exception if the :outputs: object is not JSON-serializable
|
|
return outputs
|