-1

I have the following log line

2021-10-28 10:26:19,624 INFO [Native-Thread-7f9e6effd700] idol.nifi.connector.GetWeb GetWeb[id=c59c415c-017c-1000-195c-e85818b0a032] Processing: [depth:0] https://qed.qld.gov.au/about-us/rti/disclosure-log/disclosure-log-2015

I want to extract the date and everything that comes after the word Processing: so that is looks like

2021-10-28 10:26:19 [depth:0] https://qed.qld.gov.au/about-us/rti/disclosure-log/disclosure-log-2015

I am not sure how to achieve this with grep or sed?

#!/bin/bash cat ./logs/*.log | grep Processing: | grep -E "(\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d)"

is as far as I got.

HatLess
  • 10,622
  • 5
  • 14
  • 32
Vinay Joseph
  • 5,515
  • 10
  • 54
  • 94

1 Answers1

0
sed 's/,.*Processing://' file

Output:

2021-10-28 10:26:19 [depth:0] https://qed.qld.gov.au/about-us/rti/disclosure-log/disclosure-log-2015

See: man sed and The Stack Overflow Regular Expressions FAQ

Cyrus
  • 84,225
  • 14
  • 89
  • 153