Create a splunk search

    CLI Example:

        splunk_search.create 'my search name' search='error msg'

def create(name, profile="splunk", **kwargs):
    '''
    Create a splunk search

    CLI Example:

        splunk_search.create 'my search name' search='error msg'
    '''
    client = _get_splunk(profile)
    search = client.saved_searches.create(name, **kwargs)

    # use the REST API to set owner and permissions
    # this is hard-coded for now; all managed searches are app scope and
    # readable by all
    config = __salt__['config.option'](profile)
    url = "https://{0}:{1}".format(config.get('host'), config.get('port'))
    auth = (config.get('username'), config.get('password'))
    data = {
        "owner": config.get("username"),
        "sharing": "app",
        "perms.read": "*",
    }
    _req_url = "{0}/servicesNS/{1}/search/saved/searches/{2}/acl".format(
        url, config.get("username"), urllib.quote(name)
    )
    requests.post(_req_url, auth=auth, verify=True, data=data)
    return _get_splunk_search_props(search)