Splunk Search

Update search command string of search Manager by js

cuongnguyen112
Engager

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

kamlesh_vaghela
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
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...