I am working on Linux and I'm running the following:
$ ls -t postgresq*.log | head -n1 | xargs grep "ALTER USER"
< pg_user 2021-07-15 05:03:41.609 EDT > LOG: statement: ALTER USER username WITH ENCRYPTED PASSWORD 'JUly@#12' valid until '2021-07-20';
But I only want to grep the string below:
ALTER USER username WITH ENCRYPTED PASSWORD 'JUly@#12' valid until '2021-07-20';