Archive
Highlighted

Update search command string of search Manager by js

i have an button that change the search command string, i want to update that string to "search" of searchManager and trigger the it to update data in the view
is that possible ?

can some one please help ?
example is better for me to understand .

0 Karma
Highlighted

Re: Update search command string of search Manager by js

SplunkTrust
SplunkTrust

@cuongnguyen112

You can update SearchManager using below JS code.

var searchManager = new SearchManager(...) // this is your search manager
var UpdatedSearchCommand  = "Search My new search String";
searchManager.settings.set("search",UpdatedSearchCommand  )
searchManager.startSearch();

Thanks

0 Karma
Speak Up for Splunk Careers!

We want to better understand the impact Splunk experience and expertise has has on individuals' careers, and help highlight the growing demand for Splunk skills.