Script básico AWR con el que queremos asociar lineas adyacentes de un fichero de log:
#!/bin/awk -f
BEGIN {
FS="#";
FECPREV="";
FEC="";
}
{
FECPREV=FEC;
FEC=$1;
print FECPREV "-" FEC;
}
Uso: ./awk.sh ...fichero... |grep ...
por ejemplo, el alert de una base de datos donde tenemos:
...
Stopping background process MMON
License high water mark = 1
Wed Aug 29 01:09:38 CEST 2012
ALTER DATABASE CLOSE NORMAL
...
Y queremos mostrar la fecha y hora de todas los cierres de la bbdd:
./awk.sh alertSID.log |grep "ALTER DATABASE CLOSE NORMAL"
Wed Aug 29 01:09:38 CEST 2012-ALTER DATABASE CLOSE NORMAL
ALTER DATABASE CLOSE NORMAL-Wed Aug 29 01:09:38 CEST 2012
Wed Aug 29 01:09:38 CEST 2012-Completed: ALTER DATABASE CLOSE NORMAL
Completed: ALTER DATABASE CLOSE NORMAL-Wed Aug 29 01:09:38 CEST 2012
Thu Aug 30 01:07:53 CEST 2012-ALTER DATABASE CLOSE NORMAL
ALTER DATABASE CLOSE NORMAL-Thu Aug 30 01:07:53 CEST 2012
Thu Aug 30 01:07:53 CEST 2012-Completed: ALTER DATABASE CLOSE NORMAL
Completed: ALTER DATABASE CLOSE NORMAL-Thu Aug 30 01:07:53 CEST 2012
Exelente
ResponderEliminarBorgata Hotel Casino & Spa - JTR Hub
ResponderEliminarLocated in Atlantic City, 출장안마 Borgata Hotel Casino & Spa titanium metal trim offers the finest in amenities and entertainment. It also provides https://jancasino.com/review/merit-casino/ a seasonal outdoor swimming poormansguidetocasinogambling.com