Skip to content

Instantly share code, notes, and snippets.

@cvvs
Last active June 16, 2023 21:19
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 cvvs/de886c257e49136055913cf076285fdc to your computer and use it in GitHub Desktop.
Save cvvs/de886c257e49136055913cf076285fdc to your computer and use it in GitHub Desktop.
NuShell Goodness
# Grug Parse Prometheus Metrics
# Add other labels of interest (this matches too, eg, my_label1 and label1 would both match)
http get http://host.example.com | lines | where { |line| $line !~ '$'^#' } | parse -r '^(?P<metric>\w+)\{.*label1="(?P<label1>\w+)".*} (?<value>[\de\.\+]+)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment