Thanks, jeffland.
I find out that I can add id attribute of my search from 6.2. And that really makes sense.
Actually, before 6.2 (like 6.1), there is no id attribute of search, and splunk will give the id to search by default. The default id will be search1, search2...according to the sequence of searches.
... View more
It doesn't work for me. The error is the same.
However, I can use both "var mySearch = splunkjs.mvc.Components.getInstance("search1") " and "var mySearch = mvc.Components.get('search1');" to get the object of searchManager in my js file.
The problem is that I can't get the object according to the "id" of search label, like "var mySearch = mvc.Components.get('pie_search')". No matter how I change the "id" of search label, the only way to acquire the object is by the "id" search1.
... View more
xml code:
< search id= 'pie_search'>
< query>index=mtest1 | stats sum(num) by fruit</query>
< /search>
js code:
var mySearch = mvc.Components.get('pie_search');
mySearch.startSearch();
Error:
Uncaught TypeError: Cannot read property 'startSearch' of undefined
Can anyone please tell me what I am missing?
... View more
Hello,
I'm working on web framework by using Django binding.
I got a problem recently that I couldn't get more than 100 rows by using the following code. Is there anyone who knows how to solve this problem?
Thanks in advance.
mySearch = splunkjs.mvc.Components.getInstance("search1");
myResults = mySearch.data("results");
myResults.on("data", function() {
var artistData = myResults.data().rows; // The search results
$(artistData).each(function(i,artistDatum ) {
device[i] = artistDatum[0];
});
})
... View more