Splunk Dev

TableView using splunkjs can show events but not tabular results. What am I doing wrong - or is it a bug

svenwendler
Path Finder

Tableview will only show events but I can not get it to show any table ie. "results" instead of "events".

For example:
"index = _internal | head 10"
works, but
"index = _internal | head 10 | table *" does not.

I know I have results because I can log them to console using sm.data("results");

require([
    'jquery',
    'underscore',
    'splunkjs/ready!',
    'splunkjs/mvc/searchmanager',
    'splunkjs/mvc/searchcontrolsview',
    'splunkjs/mvc/timelineview',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/eventsviewerview',
    'splunkjs/mvc/searchbarview'
    ],
    function(
        $,
        _,
        mvc,
        SearchManager,
        SearchControlsView,
        TimelineView,
        EventsViewer,
        TableView,
        SearchbarView
    ) {

        var sm =new SearchManager({
            id:  'main-search',
           search: '|inputlookup r.csv',

            preview: true,
            autostart: false,
        });

        var sb = new SearchbarView({
            id: 'main-searchbar',
            managerid: 'main-search',
            value: mvc.tokenSafe('$search$'),
            timerange_value: mvc.tokenSafe('$timeRange$'),
            el: $('#main-searchbar')
        }).render();

        sb.on("change", function() { 
           sm.settings.unset("search");
           sm.settings.set("search", sb.val());
           sm.startSearch();

       });

        var tv= new TableView({
            id: 'main-events',
            data: "results" ,
            managerid: 'main-search',
            el: $('#main-events')
        }).render();

        sm.on("search:done", function() {
            console.log(tv.settings.get("data"));
            console.log(sm.data("results"));
        });
});

And the dashboard:

<dashboard  script="searchtimeline.js">
  <label>ML Data Preparation</label>
  <row>
    <panel>
      <html>
       <div id="main-searchbar"></div>
       <div id="main-searchcontrols"></div>
           <div id="main-area">
                <div id="main-timeline"></div>
                <div id="main-events"></div>
            </div>
      </html>

    </panel>
  </row>
</dashboard>

I'm using Splunk 6.4.1 on Firefox.

0 Karma
1 Solution

svenwendler
Path Finder

Made it work by commenting out :

Line 9
// 'splunkjs/mvc/eventsviewerview',

and

Line 19
// EventsViewer,

It seems to be a bug in splunk.

View solution in original post

0 Karma

svenwendler
Path Finder

Made it work by commenting out :

Line 9
// 'splunkjs/mvc/eventsviewerview',

and

Line 19
// EventsViewer,

It seems to be a bug in splunk.

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