Skip to content

Instantly share code, notes, and snippets.

@Avotrix
Avotrix / custom_table_icon_set_rangemap.xml
Created January 10, 2019 19:20
XML for Custom icon in tables
<dashboard script="table_icons_inline.js" stylesheet="table_decorations.css">
<label>Table Icon Set (Inline)</label>
<description>Add icons to table cells based on custom conditions.</description>
<row>
<table id="table1">
@Avotrix
Avotrix / table_icons_rangemap.js
Created January 10, 2019 19:21
JS for Custom icon in tables
require([
'underscore',
'jquery',
'splunkjs/mvc',
'splunkjs/mvc/tableview',
'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {
var CustomIconRenderer = TableView.BaseCellRenderer.extend({
canRender: function(cell) {
@Avotrix
Avotrix / table_decorations.css
Last active February 14, 2019 15:38
CSS for Custom icon in tables
/*Custom Icons*/
td.icon {
text-align: center;
}
td.icon i {
font-size: 25px;
text-shadow: 1px 1px #aaa;
}
<iframe src="http://splunkhost/account/insecurelogin?username=username&password=password&return_to=/app/search/dashboardname" ></iframe>
splunk edit cluster-config -mode master -rebalance_threshold 0.95 -auth admin:your_SplunkWeb_password
mvc.Components.get('tblCrashReport').getVisualization(function(tableView)
{
tableView.table.addCellRenderer(new CustomTooltipRenderer());
tableView.table.render();
});
render: function($td, cell) { var message = cell.value;
var tip = cell.value;
if(message.length > 48) { message = message.substring(0,47) + "..." }
$td.html(_.template('<a href="#" data-toggle="tooltip" data-placement="left" title="<%- tip%>"><%- message%></a>',
{
tip: tip,
message: message
}));
// This line wires up the Bootstrap tooltip to the cell markup
$td.children('[data-toggle="tooltip"]').tooltip();
.tooltip-inner { max-width: 400px;
text-align: left;
font-size: 14px;
font-weight: normal;
}
@Avotrix
Avotrix / Drilldown
Created January 18, 2019 20:26
Drilldown
<drilldown>
<set token="show">$click.value$</set>
<set token="show_panel">true</set>
</drilldown>
@Avotrix
Avotrix / xml
Created January 29, 2019 20:17
Create ServiceNow incident through splunk
<?xml version="1.0" encoding="UTF-8"?>
<email_incident>
<Caller>Splunk_User</Caller>
<onBehalfOf>Splunk_User</onBehalfOf>
<ConfigurationItem>$result.Hostname$</ConfigurationItem>
<Category>generic</Category>
<Subcategory>generic</Subcategory>
<AssignmentGroup>$result.Assignment_group$</AssignmentGroup>
<Urgency>Low</Urgency>
<ShortDescription>SecOps </ShortDescription>