Skip to content

Instantly share code, notes, and snippets.

@amsv01
Last active April 25, 2022 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amsv01/bf2dbb6b5da0934d0065ab5c909ddc2f to your computer and use it in GitHub Desktop.
Save amsv01/bf2dbb6b5da0934d0065ab5c909ddc2f to your computer and use it in GitHub Desktop.
Expand all nested Splunk result objects
// ==UserScript==
// @name Splunk expands
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @include *://*.domain.se/*
// @include *://domain.com/*
// @include https://domain.se/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
function autoExpand(){
var found = false;
$(document).ready(function() {
$(".jsexpands").each(function() {
if($(this).html() == '[+]') {
found=true;
$(this)[0].click();
}
});
});
if (found) {
setTimeout(function(){
$('.modalize-table-overlay').click();
}, 500);
}
}
// select the target node
var target = document.body;
// create an observer instance
var observer = new MutationObserver(function(mutations) {
autoExpand();
});
// configuration of the observer:
var config = { attributes: true, childList: true, characterData: true, subtree:true};
// pass in the target node, as well as the observer options
observer.observe(target, config);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment