Dashboards & Visualizations

SingleView is returning "No search set."

cchitten
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

piUek
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

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

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 ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...