Last active
May 17, 2021 05:45
-
-
Save nikhilw/80e537b98895017645280f6c7c10d762 to your computer and use it in GitHub Desktop.
Scroll AWS cloudwatch logs up, when search is not enough: a js script that runs scroll for given number of times
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
function scrollLogUp(times, currVal) { | |
currVal = currVal || 0; | |
if (times > currVal) { | |
scrollLogUp.timer = setTimeout(function() { | |
document.getElementsByClassName("cwdb-log-viewer-table-body")[0].scrollTop = 0; | |
scrollLogUp(times, ++currVal); | |
}, 1000); | |
} else { | |
console.log("done..") | |
} | |
} | |
// To scroll up 10 times, run: scrollLogUp(10) | |
// To stop scrolling, when you reach your intended log, run: clearTimeout(scrollLogUp.timer) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment