EventsViewerView

The EventsViewer view

Description

The EventsViewer view displays Splunk events in a table that supports pagination and variable formatting. Given a search manager, the EventsViewer displays the events corresponding to that search.

Library path

Simple XML wrapper

Properties

Name

Default value

Description

id Required. The unique ID for this control.
countThe number of events to display per page.
data"events"The type of data to retrieve from the search results
results | preview | events | summary | timeline ).
drilldownRedirecttrueIndicates whether to redirect to a search page when clicked. When true, a refined search corresponding to the point that was clicked is displayed in the search app.
list.drilldown"full"The type of drilldown action ( full | inner | outer | none ).
  • full: Enables the entire entry for drilldown.
  • inner: Enables inner elements of the event listing for drilldown.
  • outer: Enables outer elements of the event listing for drilldown.
  • none: Disables drilldown.
list.wraptrueIndicates whether to wrap the events in a list viewer.
manageridnullThe ID of the search manager to bind this view to.
maxLinesThe maximum number of lines to display for each result or event.
pagerPosition"bottom"The position of the paginator ( top |bottom ).
raw.drilldown"full"The type of drilldown action ( full | inner | outer | none ).
  • full: Enables the entire entry for drilldown.
  • inner: Enables inner elements of the event listing for drilldown.
  • outer: Enables outer elements of the event listing for drilldown.
  • none: Disables drilldown.
rowNumberstrueIndicates whether to display row numbers.
settingsThe properties of the view. See the methods below to get and set values.
showPagertrueIndicates whether to display the table pagination control.
softWrapDeprecated. Indicates whether to enable soft wrapping of text in the viewer.
table.drilldowntrueIndicates whether to enable drilldown.
table.sortColumnThe name of the column to sort by.
table.sortDirection"asc"The direction to sort ( asc | desc ).
table.wrapIndicates whether to wrap the events in a table viewer.
type"list"The format type for displaying events ( list | raw | table ).

Methods

Name

Description

renderDraws the view to the screen. Called only when you create the view manually.
settings.get( property )Returns the value of property for the current component.
settings.set( propertyvalue )Sets the value of property to the specified value for the current component.

Events

Name

Description

clickFired when the events viewer is clicked.

Example

require([
    "splunkjs/mvc/eventsviewerview",
    "splunkjs/mvc/simplexml/ready!"
], function(EventsViewer) {

    // Instantiate components
    tableviewer = new EventsViewer({
        id: "example-eventsviewer",
        managerid: "example-search",
        type: "table",
        "table.drilldown": true, // Place complex property names within quotes
        drilldownRedirect: false,
        "table.sortColumn": "sourcetype",
        "table.sortDirection": "asc",
        "table.wrap": true,
        count: 5,
        pagerPosition: "top",
        rowNumbers: false,
        el: $("#myeventsviewer")
    }).render();

    // Create a click event handler
    tableviewer.on("click", function(e) {
        e.preventDefault();
        console.log("Click event"); 
        // TO DO: Do something when the events viewer is clicked
    });         
});