Splunk Search

Function startSearch() is not a function.

danillopavan
Communicator

Facing issues to run a search using SearchManager. The error says that function startSearch() is not a function. I am facing this issue in splunk version 6.6.2 Anyone know why this function is not more availabe on 6.6.2 version?

Tags (1)
0 Karma
1 Solution

danillopavan
Communicator

Hi all,

Just to inform that now it is working.

Before i was just using the "DEFINE" in the start of Javascript file indicating the usage of SearchManager.js:

define([
'underscore',
'backbone',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc/simplexml/element/table'
], function(_, Backbone, $, mvc, SearchManager, TableElement) {

I have included the below variable forcing to use the SearchManager lib:

        var SearchManager = require("splunkjs/mvc/searchmanager");

After this inclusion, the function startSearch() began to work fine.

Thanks all

View solution in original post

0 Karma

danillopavan
Communicator

Hi all,

Just to inform that now it is working.

Before i was just using the "DEFINE" in the start of Javascript file indicating the usage of SearchManager.js:

define([
'underscore',
'backbone',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/searchmanager',
'splunkjs/mvc/simplexml/element/table'
], function(_, Backbone, $, mvc, SearchManager, TableElement) {

I have included the below variable forcing to use the SearchManager lib:

        var SearchManager = require("splunkjs/mvc/searchmanager");

After this inclusion, the function startSearch() began to work fine.

Thanks all

0 Karma

niketn
Legend

@danillopavan, please accept your own answer to mark this question as answered.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI danillopavan,

can you please show your sample code?

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...