<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to update Search Command by JS in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465536#M191718</link>
    <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Glad to help you.&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2019 11:29:46 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2019-10-24T11:29:46Z</dc:date>
    <item>
      <title>How to update Search Command by JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465533#M191715</link>
      <description>&lt;P&gt;Hello , &lt;BR /&gt;
I am using splunk WebFramework to develop, and i got an problem with update splunk search Command by JS&lt;/P&gt;

&lt;P&gt;Current Status : &lt;BR /&gt;
i have seperate SearchManager and Search Command of that like below : &lt;/P&gt;

&lt;P&gt;var searchCommand =  "index IN (*) | sort -_time"&lt;/P&gt;

&lt;P&gt;var searchManager = new SearchManager({&lt;BR /&gt;
            "id": "search",&lt;BR /&gt;
            "search": searchCommand,&lt;BR /&gt;
            "status_buckets": 0,&lt;BR /&gt;
            "cancelOnUnload": true,&lt;BR /&gt;
            "app": utils.getCurrentApp(),&lt;BR /&gt;
            "auto_cancel": 90,&lt;BR /&gt;
            "preview": true,&lt;BR /&gt;
            "earliest_time":"-240h@h",&lt;BR /&gt;
            "latest_time":"now" ,&lt;BR /&gt;
            "runWhenTimeIsUndefined": false&lt;BR /&gt;
        }, {&lt;BR /&gt;
            tokens: true,&lt;BR /&gt;
            tokenNamespace: "submitted"&lt;BR /&gt;
        });&lt;/P&gt;

&lt;P&gt;now i need an button to trigger an event that update the searchCommand and re-search.&lt;BR /&gt;
Is there anyway for me to do that ?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465533#M191715</guid>
      <dc:creator>cuongnguyen112</dc:creator>
      <dc:date>2020-09-30T02:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to update Search Command by JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465534#M191716</link>
      <description>&lt;P&gt;@cuongnguyen112 &lt;BR /&gt;
Can you please try below javascript code?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;searchManager.settings.set("search",UpdatedSearchCommand  )
searchManager.startSearch();
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Oct 2019 10:20:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465534#M191716</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-10-24T10:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to update Search Command by JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465535#M191717</link>
      <description>&lt;P&gt;look like i missing the "quote" over there :D, thank you so much kamlesh &lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:16:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465535#M191717</guid>
      <dc:creator>cuongnguyen112</dc:creator>
      <dc:date>2019-10-24T11:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to update Search Command by JS</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465536#M191718</link>
      <description>&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Glad to help you.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-Search-Command-by-JS/m-p/465536#M191718</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-10-24T11:29:46Z</dc:date>
    </item>
  </channel>
</rss>

