Skip to content

Instantly share code, notes, and snippets.

@nikhilw
Last active May 17, 2021 05:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilw/80e537b98895017645280f6c7c10d762 to your computer and use it in GitHub Desktop.
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
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