Skip to content

Instantly share code, notes, and snippets.

@JohnL4
Created May 26, 2021 15:21
Show Gist options
  • Save JohnL4/ae568e0ecc27f7a213f243ab0cf6289e to your computer and use it in GitHub Desktop.
Save JohnL4/ae568e0ecc27f7a213f243ab0cf6289e to your computer and use it in GitHub Desktop.
awk | sort -unique in PowerShell
cat scheduled-task-2021-05-25.log `
| sls 'Probe foo_.*' `
| % {$_.Matches[0].Captures[0].Value} `
| sort -uniq
<#
Matches is array of matches in line (could be multiple, for repeated occurrences of the pattern).
Groups is regexp capture groups, [0] is entire matched string (I guess)
#>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment