Splunk Search

Using D3 donut with real-time search

dimitryz
Path Finder

Hi all,
I'm tying to use D3 donut chart with splunk real-time search.
I've defined SearchManager this way :
var search1 = new SearchManager({
"id": "search1",
"cancelOnUnload": true,
"latest_time": "rt",
"earliest_time": "rt",
"status_buckets": 0,
"search": "index=_internal |stats count by sourcetype",
"app": utils.getCurrentApp(),
"auto_cancel": 90,
"search_mode": "realtime",
"preview": true,
"runWhenTimeIsUndefined": true
}, {tokens: true});

And chart configuration is :

var donut_chart = new D3ChartView({
"id": "donut",
"managerid": "search1",
"type": "pieChart",
"el": $('#hook1')
}).render();

donut_chart.settings.set("setup", function(chart){
chart.color(d3.scale.category10().range());

chart.donut(true);

});

The problem is that I can't make real-time data to be shown correctly .
Unchecking one of parameters of donut chart suppose to change the chart itselt.
It's happening only for few seconds and atter it the parameter beckame checked again.
In search is not real-time uncheckin/checking working ok.
How can I solve the problem ?
Thanks.

Tags (2)
0 Karma

rcorbisier_splu
Splunk Employee
Splunk Employee

If you haven’t seen it yet, you might want to check out the Splunk reference app (https://splunkbase.splunk.com/app/1934/) with associated developer guidance (http://dev.splunk.com/goto/devguide) that was built by a Splunk dev team.

The current version covers app development topics from getting your data into Splunk Enterprise to building custom reporting through testing and packaging your app. There’s code (https://github.com/splunk/splunk-ref-pas-test) and tests (https://github.com/splunk/splunk-ref-pas-test) you can use and the development process is fully documented.

This is an ongoing dev effort by the team so check back often to see what’s been added. Also, feel free to post requests for future improvements and even contribute by reporting bugs or submitting pull requests.

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 at Splunk .conf24 ...

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