Bonjour,

je cherche à faire un script shell qui pourrait me filtrer un fichier de log, je m'explique, j'ai ce fichier :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
(idf=AL69,part=ETEBAIX,fname=/apps/cftant/recparis/) Number of error(s) 0 Ending Session on 07/09/2016 Time is 03:53:20
(part=M086204D,idf=ADCVIS01,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 06/09/2016 Time is 21:02:11
(idf='000000P9',part=BNP9IC01,fname=/apps/cftant/re) Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:39:41
(idf='000000P9',part=BNP9IC02,fname=/apps/cftant/re) Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:40:08
(idf='000000P9',part=BNP9IC03,fname=/apps/cftant/re) Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:40:34
(part=IA179040,idf=OXALYSB3,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
(part=IA105002,idf=OXALYSB1,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
(part=IA179020,idf=OXALYSB2,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
(part=IA179040,idf=OXALYSB3,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:40:17
(part=IA179040,idf=OXALYSB3,fname=/apps/cftant/recp) Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:26:57

je dois récupérer l'idf entre les parenthèses et garder le reste de la ligne, cela donnerait :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
AL69 Number of error(s) 0 Ending Session on 07/09/2016 Time is 03:53:20
ADCVIS01 Number of error(s) 0 Ending Session on 06/09/2016 Time is 21:02:11
000000P9 Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:39:41
000000P9 Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:40:08
000000P9 Number of error(s) 0 Ending Session on 06/09/2016 Time is 22:40:34
OXALYSB3 Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
OXALYSB1 Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
OXALYSB2 Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:50:13
OXALYSB3 Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:40:17
OXALYSB3 Number of error(s) 0 Ending Session on 07/09/2016 Time is 14:26:57
Par avance, merci