Skip to content

Instantly share code, notes, and snippets.

@pniederlag
Last active July 1, 2020 20:12
Show Gist options
  • Select an option

  • Save pniederlag/0848554e32ad664e037d35d857cb968d to your computer and use it in GitHub Desktop.

Select an option

Save pniederlag/0848554e32ad664e037d35d857cb968d to your computer and use it in GitHub Desktop.
rebuild started
01.06.2018 05:21:32
1593581ueuie
erunireaundenr
rnudnenuden
rebuild finished
15935udanedue
01.06.2018 06:01:09
rebuild started
02.06.2018 09:14:34
15uieuieuieuie
rebuild failed
uedurnaerdt
ruertudren
duriaetie
....
rebuild finished
irdonidonirn
02.06.2020 09:25:31
/rebuild started/ {getline startdate;statusline=" OK "}
/rebuild failed/ {statusline=" FAILED "}
/rebuild finished/ {getline ignore; getline enddate; sub("([0-9]{2}\\.[0-9]{2}\\.[0-9]{4} )", "", enddate);print startdate " bis " enddate " : " statusline " "}
awk -f example-variables.awk example-stream.log
01.06.2018 05:21:32 bis 06:01:09 : OK
02.06.2018 09:14:34 bis 09:25:31 : FAILED
@pniederlag
Copy link
Copy Markdown
Author

Ease of use of awk compared to sed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment