Eu tenho um arquivo de texto que se parece com isso:
Start find in flight queries
2018-03-05 15:50:02,069:INFO:######################################
Start find completed queries
2018-03-05 15:50:02,070:INFO:Starting new HTTPS connection (1): server060
2018-03-05 15:50:02,083:DEBUG:"GET /queries?json HTTP/1.1" 401 0
2018-03-05 15:50:02,084:INFO:Resetting dropped connection: server060
2018-03-05 15:50:02,095:DEBUG:"GET /queries?json HTTP/1.1" 200 19059
2018-03-05 15:50:02,099:INFO:######################################
Start find in flight queries
A data e a hora mudam a cada 5 minutos. Preciso copiar a última data e hora para outro arquivo. Neste exemplo, é 2018-03-05 15:50:02. Todas as sugestões são apreciadas. Eu usei um pouco de regex no passado, mas não era bom nisso.
tac
+grep
solução:Usando awk sem pipes ;)