Skip to content

Instantly share code, notes, and snippets.

@zouchao
Last active December 15, 2021 03:46
Show Gist options
  • Save zouchao/6a9fc7c250e60de63066d7c3d2370112 to your computer and use it in GitHub Desktop.
Save zouchao/6a9fc7c250e60de63066d7c3d2370112 to your computer and use it in GitHub Desktop.
获取 Grafana 日志中的某个 Key
content = []
$('.css-jtwxy5-logs-rows').html().replace(/post_id[^\:]*:"(\w+)"/g, function($0, $1) {
content.push($1);
return $0;
})
// 删除某个元素
Array.prototype.remove = function(val) {
var index = this.indexOf(val);
if (index > -1) {
this.splice(index, 1);
}
return this
};
// 去重
Array.prototype.uniq = function() {
return Array.from(new Set(this))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment