Dashboards & Visualizations
Highlighted

SingleView is returning "No search set."

Path Finder

I have created a search manager and then a single view using Django tags and javascript. The SingleView element shows us in my splunk app but I only see the text "No search set.".
This is the search manager:

 new SearchManager({
                                                id: "managerID",
                                                preview: true,
                                                cache: true,
                                                status_buckets: 300,
                                                search: searchQuery (<--long search query but works fine when searched in the search app)
                                        });

This is the singleview:

new SingleView({
                                                id: "uniqueID",
                                                managerid: "managerID",
                                                field: "field1",
                                                el: $("#singleview")
                                        }).render();

What could be causing this?

0 Karma
Highlighted

Re: SingleView is returning "No search set."

New Member

Check out if you have any quots or any special characters in the search query. If yes escape them with .
,Hi,

The issue could be with the special characters like quots in the search query. Escaping them should fix the issue.

0 Karma
Highlighted

Re: SingleView is returning "No search set."

Path Finder

I've run into the same problem today.

In my custom SimpleSplunkView I've that's its receiving data from the search, but it said 'No search set'.
Strange but my guess would be that the initialization of the search takes some time and it's still not initialized when the view is starting to initialize, so it initialize method returns 'No search set'.

I've found few solutions to this problem.
One is to move search to django/xml definition, so we can have a handler to it after it's initialized.

Other solution I've managed to get running is to create the custom view after the search is initialized
Im using underscore _.once() method to call this function only once, but it could be also if check to see if the view was created. Or maybe there is a better handler, I haven't found it yet.

  searchResults.on('search:done', _.once(function() {
    var swimlaneView = new SwimlaneView({
      name: "mycustomview",
      managerid: "sla1_query",
      el: $("#swimlane_view")
    }).render();
  }));
0 Karma