-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add custom row expansion to reveal raw events
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
require([ | ||
'splunkjs/mvc/tableview', | ||
'splunkjs/mvc/eventsviewerview', | ||
'splunkjs/mvc/searchmanager', | ||
'splunkjs/mvc', | ||
'underscore', | ||
'splunkjs/mvc/simplexml/ready!' | ||
],function(TableView, EventsViewerView, SearchManager, mvc, _) { | ||
var EventSearchBasedRowExpansionRenderer = TableView.BaseRowExpansionRenderer.extend({ | ||
initialize: function(args) { | ||
this._searchManager = new SearchManager({ | ||
id: 'details-search-manager', | ||
preview: false | ||
}); | ||
this._chartView = new EventsViewerView({ | ||
managerid: 'details-search-manager', | ||
type: "raw", | ||
'raw.drilldown': "none" | ||
}); | ||
}, | ||
canRender: function(rowData) { | ||
return true; | ||
}, | ||
render: function($container, rowData) { | ||
var sourcetypeCell = _(rowData.cells).find(function (cell) { | ||
return cell.field === 'sourcetype'; | ||
}); | ||
|
||
var indexCell = _(rowData.cells).find(function (cell) { | ||
return cell.field === 'index'; | ||
}); | ||
this._searchManager.set({ search: `index=${indexCell.value} sourcetype=${sourcetypeCell.value} | dedup punct`}); | ||
$container.append(this._chartView.render().el); | ||
} | ||
}); | ||
var tableElement = mvc.Components.getInstance("table1"); | ||
tableElement.getVisualization(function(tableView) { | ||
tableView.addRowExpansionRenderer(new EventSearchBasedRowExpansionRenderer()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters