Skip to content

Instantly share code, notes, and snippets.

@LukeMurphey
Last active December 16, 2015 02:09
Show Gist options
  • Save LukeMurphey/5360789 to your computer and use it in GitHub Desktop.
Save LukeMurphey/5360789 to your computer and use it in GitHub Desktop.
This segment of application JS causes Simple Results Table in Splunk to include the field value as an attribute in the table cells. This allows you to style the cells based on the contents. Tags: #splunk
if( Splunk.Module.SimpleResultsTable ){
Splunk.Module.SimpleResultsTable = $.klass(Splunk.Module.SimpleResultsTable, {
renderResults: function($super, htmlFragment) {
$super(htmlFragment);
if (this.getInferredEntityName()=="events") {
this.renderedCount = $("tr", this.container).length - 1;
}
$.each( $('.simpleResultsTable td'), function(index, value) {
$(this).attr('data-value', $(this).text() );
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment