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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...