- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Python SDK Saved Search Variable Passing
caden00
Observer
08-04-2021
09:18 AM
I am using Python to access and saved search. I want to then run this saved search. I understand how to do this using the .dispatch method. The issue I am having is that I have a search with search variables, for example
| eval state="$state$"
Using SPL I simply call
| savedsearch "somesearch" state="state"
In Python I have seen with JS you can pass
{state: somestate}
in the .dispatch() method.
In Python however, any time I attempt to pass a parameter with these values I get various errors. Any help in the direction of passing a variable name would be great!
Thanks
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
08-04-2021
09:46 AM
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
caden00
Observer
08-04-2021
10:16 AM
Passing this returns that the value "state" is not supported by this handler.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

kamlesh_vaghela

SplunkTrust
08-04-2021
11:51 PM
Can you please try this?
kwargs = {"args.state": "state"}
job = mysavedsearch.dispatch(**kwargs)
KV
