Dashboards & Visualizations

Django TableView: Open in search/Export option

MaverickT
Communicator

I am migrating my dashboards from advanced XML to new Splunk Web Framework (django). By using postprocessmanagers whole dashboard loads much faster but I have to find workaround for TableView that we need. In simple and advanced XML there is always an option to have links at the bottom of the table to export resuls or open results in search. I have tried to make workaround with javascript but there is no difference (code sample included). Can anybody give me a hint how to do it?

    var deps = [
        "splunkjs/ready!",
        "underscore",
        "splunkjs/mvc/radiogroupview",          
        "splunkjs/mvc/tableview",
    ];
    require(deps, function(mvc, _) {            

        var tableHosts = splunkjs.mvc.Components.getInstance("table_hosts");
        tableHosts.settings.set({
            "link.exportResults.visible": true,
            "link.openSearch.visible": true,
            "link.visible": true
            }
        );
    });

mgroves_splunk
Splunk Employee
Splunk Employee

I have logged a enhancement request for this feature. Thanks for the feedback.

-Mark

Rocket66
Communicator

Hmm, I use a table in an app and I have the "export", "open in search" and "inspect" options under that table.

Code I used :

var deps = [
"splunkjs/mvc",
"underscore",
"jquery",    
"splunkjs/ready!",
    "splunkjs/mvc/simplexml/element/table"
]; require(deps, function(
    mvc,
    _,
    $
    ) 
    {
         var TableElement = require("splunkjs/mvc/simplexml/element/table");

          var mychart = new TableElement({
              "id": "my_chart",
              "managerid": "search1",
              "el": $("#RenderPanel")
          }, {tokens: true}).render();
    });

"splunkjs/mvc/tableview" differs from "splunkjs/mvc/simplexml/element/table" - so try to use the simplexml-element.

aelliott
Motivator

It has to be through javascript

0 Karma

guilmxm
Influencer

Hi,

I have the same requirement, can you achieve the same thing (for both tables and charts) when using the django request to render the item ?

As for an example:

   {% table 
        id="table1-info-hosts" 
        managerid="info-hosts"
        resizable="true"
        drilldown="cell"
        pageSize="20"
   %}

I've tried:

            splunkjs.mvc.Components.getInstance("table1-info-hosts").settings.set({

...

});

But does not work

0 Karma

aelliott
Motivator

I also wanted to note that the interesting part is that the items on this link: http://docs.splunk.com/DocumentationStatic/WebFramework/1.0/compref_wrapper.html
work only for the simplexml as posted in this answer, yet it does not mention that in the Component Reference( http://docs.splunk.com/Documentation/WebFramework ). I think this is hugely missed when starting from scratch and creating a new dashboard.

These references to simplexml libraries would only be found out when converting an existing simple dashboard to an html one.
Wrappers and views: http://dev.splunk.com/view/SP-CAAAETA

aelliott
Motivator

This indeed works. This makes me wonder what the point of the "splunkjs/mvc/tableview" is..

It also works for charts too.

0 Karma

MaverickT
Communicator

After few weeks of playing with django/web framework it seems that it is more like half-product. It is fast but it really lacks of few features (export, easy token passing between views) that it should realy have. Hopefully guys at Splunk will improve this, I dont want to code all the dashboards again if they decide to scrap it 🙂

aelliott
Motivator

I need this functionality too! You would think they would have this feature be within the django/web framework as it should have all the features and more of the simple xml.

Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...