Skip to content

Instantly share code, notes, and snippets.

@ibolmo
Created September 28, 2017 02:53
Show Gist options
  • Save ibolmo/4d407b49975ae94de3c586851f06c077 to your computer and use it in GitHub Desktop.
Save ibolmo/4d407b49975ae94de3c586851f06c077 to your computer and use it in GitHub Desktop.
Get alerted when graylog has a new item.
count = () => $('.fields-row').length;
isEmpty = () => $('h1')[0].innerText == 'Nothing found';
tick = () => {
if (isEmpty()) {
found = 0;
} else if (found < count()) {
alert('Found new stuff!');
found = count();
}
setTimeout(tick, 2000);
}
go = () => {
found = count();
tick();
}
go();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment