matheusbsi
(usa Ubuntu)
Enviado em 24/11/2017 - 13:26h
Esta mesma filtragem, mas sem os segundos !
root@linuxserver-zs:/snort/alerts# cat /var/log/snort/alert
11/22-22:26:46.714694 [**] [1:1000003:1] DoS [**] [Priority: 0] {TCP} 192.168.2.10:49989 -> 192.168.2.3:80
11/22-22:26:46.719081 [**] [1:1000002:2] SCAN [**] [Priority: 0] {TCP} 192.168.2.10:49989 -> 192.168.2.3:80
11/22-22:27:47.162562 [**] [1:1000002:2] SCAN [**] [Priority: 0] {TCP} 192.168.2.10:50032 -> 192.168.2.3:80
Com a filtragem ! Mas ele retorna os segundos. E so quero a data, Horas e minutos. Sem os segundos !
root@linuxserver-zs:/snort/alerts# cat /var/log/snort/alert | awk '{print $1,$4,$8,$9,$11}' | sed -r 's/\.[0-9]{6}//;s/[{}]//g;s/ /,/g;s/:/,/3g; s/-/,/; s/^/'$(date +"%Y")'\//'
2017/11/22,22:26:46,DoS,TCP,192.168.2.10,49989,192.168.2.3,80
2017/11/22,22:26:46,SCAN,TCP,192.168.2.10,49989,192.168.2.3,80
2017/11/22,22:27:47,SCAN,TCP,192.168.2.10,50032,192.168.2.3,80
Desde ja, muito obrigado!