[PERL]- Extraire lignes d'un fichier à partir
Résolu
tonixm
Messages postés
127
Date d'inscription
Statut
Membre
Dernière intervention
-
tonixm Messages postés 127 Date d'inscription Statut Membre Dernière intervention -
tonixm Messages postés 127 Date d'inscription Statut Membre Dernière intervention -
A voir également:
- [PERL]- Extraire lignes d'un fichier à partir
- Fichier bin - Guide
- Comment réduire la taille d'un fichier - Guide
- Comment ouvrir un fichier epub ? - Guide
- Creer un groupe whatsapp a partir d'un autre groupe - Guide
- Fichier rar - Guide
36 réponses
pas exactement ce que je voulais
je veux traiter juste les "nb_line" dernières lignes du fichier n'importe lesquelles qu'elles soient.
Par exemple pour tonixm.log :lami20j@debian:~$ cat tonixm.log
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 14.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 13.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 18.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 10.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
si nb_line vaut 4.
je veux au final dans le .sort que des lignes de ce type:
vmonitor ntpd: Listening on interface wildcard, ::#123
vmonitor ntpd: Listening on interface lo, 127.0.0.1#123
vmonitor ntpd: Listening on interface eth0, 172.16.15.39#123
vmonitor ntpd: kernel time sync status 0040
C'est a dire prendre les 4 dernières lignes, enlever "Apr 9 15:58:32" et [31608] puis tout mettre dans file.sort
je veux traiter juste les "nb_line" dernières lignes du fichier n'importe lesquelles qu'elles soient.
Par exemple pour tonixm.log :lami20j@debian:~$ cat tonixm.log
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 14.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 13.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 18.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 10.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
si nb_line vaut 4.
je veux au final dans le .sort que des lignes de ce type:
vmonitor ntpd: Listening on interface wildcard, ::#123
vmonitor ntpd: Listening on interface lo, 127.0.0.1#123
vmonitor ntpd: Listening on interface eth0, 172.16.15.39#123
vmonitor ntpd: kernel time sync status 0040
C'est a dire prendre les 4 dernières lignes, enlever "Apr 9 15:58:32" et [31608] puis tout mettre dans file.sort
J'ai essayer ceci :
open (FIC,"$file");
my $line;
$line=0;
while (<FIC>){
# par défaut chaque ligne lue (y compris le délimiteur
# de fin de ligne) est stockée dans $_
if($line >= $nb_line){
$_=~ s/\[[0-9]*\]:/:/g;
system("cat $_ > $file_analyse");
}
$line++;
}
close (FIC);
Mais sans succès.
open (FIC,"$file");
my $line;
$line=0;
while (<FIC>){
# par défaut chaque ligne lue (y compris le délimiteur
# de fin de ligne) est stockée dans $_
if($line >= $nb_line){
$_=~ s/\[[0-9]*\]:/:/g;
system("cat $_ > $file_analyse");
}
$line++;
}
close (FIC);
Mais sans succès.
Salut,
mets ton fichier sur ci-joint.com
je vais regarder
ta demande n'est pas claire
si je comprends bien tu veux
1. traiter les n dernières lignes dans fichies
2. trier les lignes
Je vois aussi que tu fait une substitution.
Veux-tu être plus explicite?
Merci.
mets ton fichier sur ci-joint.com
je vais regarder
ta demande n'est pas claire
si je comprends bien tu veux
1. traiter les n dernières lignes dans fichies
2. trier les lignes
Je vois aussi que tu fait une substitution.
Veux-tu être plus explicite?
Merci.
Salut,
j'ai un fichier de log qu'il faut que je trie. J'ai mis un index "nbline" afin de ne pas retraiter a chaque fois ce que j'ai deja fait.
Il faut que:
1. traiter les n dernières lignes de mon fichier
2. trier les lignes
3. substituer certains caractères
4. remettre tout cela dans un autre fichier X.analyse
Mon tuteur m'a dit qu'il fallais "simplement" que je traduise cela en perl:
tail -$nb $fichier | sort -k 5 -u | sed -e 's/\[[0-9]*\]:/:/g' > $file.analyse
merci
j'ai un fichier de log qu'il faut que je trie. J'ai mis un index "nbline" afin de ne pas retraiter a chaque fois ce que j'ai deja fait.
Il faut que:
1. traiter les n dernières lignes de mon fichier
2. trier les lignes
3. substituer certains caractères
4. remettre tout cela dans un autre fichier X.analyse
Mon tuteur m'a dit qu'il fallais "simplement" que je traduise cela en perl:
tail -$nb $fichier | sort -k 5 -u | sed -e 's/\[[0-9]*\]:/:/g' > $file.analyse
merci
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
Re,
ce qui t'as demandé ton tuteur c'est ton problème
pour t'aider j'ai besoi de ton fichier
pour faire la traduction, il faut que je comprenne le problème
c'est comme ça que je travail moi ;-)
donc j'attends ton fichier pour faire des test
merci
ce qui t'as demandé ton tuteur c'est ton problème
pour t'aider j'ai besoi de ton fichier
pour faire la traduction, il faut que je comprenne le problème
c'est comme ça que je travail moi ;-)
donc j'attends ton fichier pour faire des test
merci
c'est un fichier confidentiel et je ne peux pas te le mettre sur cijoint.com ou .fr je ne me rappel plus sinon je l'aurais fait depuis lontemps.
merci quand même
merci quand même
Je n'ai pas besoin de connaître le contenu de ton fichier
En revanche j'ai besoin de la structure de ton fichier (tu n'as qu'à mettre des données bidons ;-))
En revanche j'ai besoin de la structure de ton fichier (tu n'as qu'à mettre des données bidons ;-))
LOG_DIR="/var/adm/syslog.dated/current"
CONF_DIR="/doi/lib"
for file in $(echo "daemon.log kern.log") ; do
FILE=$LOG_DIR/$file
if [ ! -e $FILE ]; then
echo "Error EXP039" >> $FILE.focal
exit 1
fi
CONF_FILE=$CONF_DIR/$file.cfg
if [ ! -e $CONF_FILE ]; then
echo "Error EXP039" >> $FILE.focal
exit 1
fi
PREVIOUS_FILE=$(echo $FILE | sed -e 's/current/previous/')
CURRENT_FILE_LENGHT=$(($(cat $FILE | wc -l)))
if [ ! -e $FILE.focal.end ] ; then
# Si le fichier de log n'a jamais ete parse,
# ne pas oublier de parser le fichier de log de la veille !
if [ ! -e $PREVIOUS_FILE.focal.end ] ; then
# Si le fichier de log de la veille n'a jamais ete parse,
# on a un pb ! => erreur focal !! dans le fichier du jour !
echo "Error EXP040" >> $FILE.focal
else
# Sinon, on parse le fichier de la veille
PREVIOUS_FILE_LENGHT=$(($(cat $PREVIOUS_FILE | wc -l)))
. $PREVIOUS_FILE.focal.end
NB_LINE=$(($PREVIOUS_FILE_LENGHT-$LAST_LINE))
# On redirige les logs dans un fichier temporaire
tail -$NB_LINE $PREVIOUS_FILE | sort -k 5 -u | sed -e 's/\[[
0-9]*\]:/:/g' > $FILE.sort
# On exclue les messages qui ne nous interessent pas
cat $CONF_FILE | while read line
do
cat $FILE.sort | grep -v "$line" > $FILE.tmp
cat $FILE.tmp > $FILE.sort
done
# Sans oublier de rediriger les logs dans le fichier du jour
!
# en les remettant dans l'ordre.
cat $FILE.sort | sort >> $FILE.focal
KEEP_LENGHT=$(($(cat $FILE.sort | wc -l)))
rm -rf $FILE.sort
rm -rf $FILE.tmp
echo "LAST_LINE=$PREVIOUS_FILE_LENGHT" > $PREVIOUS_FILE.foca
l.end
tracer "Keeping $KEEP_LENGHT/$NB_LINE line(s) of $PREVIOUS_F
ILE"
fi
# Une fois les logs de la veille traites, on s'occuppe des logs
du jour.
NB_LINE=$(($CURRENT_FILE_LENGHT))
else
# On reprend la ou on en etait
. $FILE.focal.end
NB_LINE=$(($CURRENT_FILE_LENGHT-$LAST_LINE))
fi
# On redirige les logs dans un fichier temporaire
tail -$NB_LINE $FILE | sort -k 5 -u | sed -e 's/\[[0-9]*\]:/:/g' > $
FILE.sort
# On exclue les messages qui ne nous interessent pas
cat $CONF_FILE | while read line
do
cat $FILE.sort | grep -v "$line" > $FILE.tmp
cat $FILE.tmp > $FILE.sort
done
# Sans oublier de rediriger les logs dans le fichier du jour !
# en les remettant dans l'ordre.
cat $FILE.sort | sort >> $FILE.focal
KEEP_LENGHT=$(($(cat $FILE.sort | wc -l)))
rm -rf $FILE.sort
rm -rf $FILE.tmp
echo "LAST_LINE=$CURRENT_FILE_LENGHT" > $FILE.focal.end
tracer "Keeping $KEEP_LENGHT/$NB_LINE line(s) of $FILE"
CONF_DIR="/doi/lib"
for file in $(echo "daemon.log kern.log") ; do
FILE=$LOG_DIR/$file
if [ ! -e $FILE ]; then
echo "Error EXP039" >> $FILE.focal
exit 1
fi
CONF_FILE=$CONF_DIR/$file.cfg
if [ ! -e $CONF_FILE ]; then
echo "Error EXP039" >> $FILE.focal
exit 1
fi
PREVIOUS_FILE=$(echo $FILE | sed -e 's/current/previous/')
CURRENT_FILE_LENGHT=$(($(cat $FILE | wc -l)))
if [ ! -e $FILE.focal.end ] ; then
# Si le fichier de log n'a jamais ete parse,
# ne pas oublier de parser le fichier de log de la veille !
if [ ! -e $PREVIOUS_FILE.focal.end ] ; then
# Si le fichier de log de la veille n'a jamais ete parse,
# on a un pb ! => erreur focal !! dans le fichier du jour !
echo "Error EXP040" >> $FILE.focal
else
# Sinon, on parse le fichier de la veille
PREVIOUS_FILE_LENGHT=$(($(cat $PREVIOUS_FILE | wc -l)))
. $PREVIOUS_FILE.focal.end
NB_LINE=$(($PREVIOUS_FILE_LENGHT-$LAST_LINE))
# On redirige les logs dans un fichier temporaire
tail -$NB_LINE $PREVIOUS_FILE | sort -k 5 -u | sed -e 's/\[[
0-9]*\]:/:/g' > $FILE.sort
# On exclue les messages qui ne nous interessent pas
cat $CONF_FILE | while read line
do
cat $FILE.sort | grep -v "$line" > $FILE.tmp
cat $FILE.tmp > $FILE.sort
done
# Sans oublier de rediriger les logs dans le fichier du jour
!
# en les remettant dans l'ordre.
cat $FILE.sort | sort >> $FILE.focal
KEEP_LENGHT=$(($(cat $FILE.sort | wc -l)))
rm -rf $FILE.sort
rm -rf $FILE.tmp
echo "LAST_LINE=$PREVIOUS_FILE_LENGHT" > $PREVIOUS_FILE.foca
l.end
tracer "Keeping $KEEP_LENGHT/$NB_LINE line(s) of $PREVIOUS_F
ILE"
fi
# Une fois les logs de la veille traites, on s'occuppe des logs
du jour.
NB_LINE=$(($CURRENT_FILE_LENGHT))
else
# On reprend la ou on en etait
. $FILE.focal.end
NB_LINE=$(($CURRENT_FILE_LENGHT-$LAST_LINE))
fi
# On redirige les logs dans un fichier temporaire
tail -$NB_LINE $FILE | sort -k 5 -u | sed -e 's/\[[0-9]*\]:/:/g' > $
FILE.sort
# On exclue les messages qui ne nous interessent pas
cat $CONF_FILE | while read line
do
cat $FILE.sort | grep -v "$line" > $FILE.tmp
cat $FILE.tmp > $FILE.sort
done
# Sans oublier de rediriger les logs dans le fichier du jour !
# en les remettant dans l'ordre.
cat $FILE.sort | sort >> $FILE.focal
KEEP_LENGHT=$(($(cat $FILE.sort | wc -l)))
rm -rf $FILE.sort
rm -rf $FILE.tmp
echo "LAST_LINE=$CURRENT_FILE_LENGHT" > $FILE.focal.end
tracer "Keeping $KEEP_LENGHT/$NB_LINE line(s) of $FILE"
Bon,
je vois qu'on ne se comprends pas
ce n'est pas le script que j'ai demandé
j'ai demandé un fichier que tu traites (donc un fichier log)
je vois qu'on ne se comprends pas
ce n'est pas le script que j'ai demandé
j'ai demandé un fichier que tu traites (donc un fichier log)
ha dsl:
daemon.log:
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 E
DT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#1
23
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#
123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
daemon.log:
Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 E
DT 2006 (1)
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#1
23
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123
Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#
123
Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040
en fait on voudrait garder par exemple pour:
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
pour cette ligne on voudrait :
vmonitor ntpd: precision = 17.000 usec
Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec
pour cette ligne on voudrait :
vmonitor ntpd: precision = 17.000 usec
il faut prendre les "nb-line" dernières lignes d'un fichier X.sort, faire un sort -k 5 -u (je ne sais pas ce que cela veut dire) puis enlevé les chiffres avant ":" par substitution.
finalement mettre tout cela dans un fichier X.analyse
aie aie je suis mal en point
finalement mettre tout cela dans un fichier X.analyse
aie aie je suis mal en point
Alors essaie celui là
#!/usr/bin/perl use strict;use warnings; open LIRE,"tonixm.log" or die "E/S : $!\n"; print "Entrez le nombre de lignes : "; chomp(my $n = <STDIN>); my @log = <LIRE>; grep {s/.*(vmonitor\s*ntpd)\[.*\](:.*)/${1}$2/} @log; print map {$_->[0]} sort {$a->[1] cmp $b->[1]} map {[$_,(split / /)[4]]} splice(@log,-$n); __END__
merci pour tout!!!
j ai le compilateur au boulot et j'essaierai sa demain au plsu vite!
j espere que cela marchera
j ai le compilateur au boulot et j'essaierai sa demain au plsu vite!
j espere que cela marchera
lami20j@debian:~$ cat log.pl #!/usr/bin/perl use strict;use warnings; open LIRE,"tonixm.log" or die "E/S : $!\n"; open ECRIRE,">fichier.analyse" or die "E/S : $!\n"; print "Entrez le nombre de lignes : "; chomp(my $n = <STDIN>); my @log = <LIRE>; grep {s/.*(vmonitor\s*ntpd)\[.*\](:.*)/${1}$2/} @log; print ECRIRE map {$_->[0]} sort {$a->[1] cmp $b->[1]} map {[$_,(split / /)[4]]} splice(@log,-$n); __END__ lami20j@debian:~$ cat tonixm.log Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 17.000 usec Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123 Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040 Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 14.000 usec Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123 Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040 Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 13.000 usec Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123 Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040 Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 18.000 usec Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123 Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040 Apr 9 15:58:32 vmonitor ntpd[31608]: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) Apr 9 15:58:32 vmonitor ntpd[31608]: precision = 10.000 usec Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, 0.0.0.0#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface wildcard, ::#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface lo, 127.0.0.1#123 Apr 9 15:58:32 vmonitor ntpd[31608]: Listening on interface eth0, 172.16.15.39#123 Apr 9 15:58:32 vmonitor ntpd[31608]: kernel time sync status 0040 lami20j@debian:~$ perl log.pl Entrez le nombre de lignes : 10 lami20j@debian:~$ cat fichier.analyse vmonitor ntpd: precision = 10.000 usec vmonitor ntpd: ntpd 4.2.0a@1.1190-r Thu Oct 5 04:11:32 EiDT 2006 (1) vmonitor ntpd: Listening on interface lo, 127.0.0.1#123 vmonitor ntpd: Listening on interface eth0, 172.16.15.39#123 vmonitor ntpd: Listening on interface wildcard, 0.0.0.0#123 vmonitor ntpd: Listening on interface wildcard, ::#123 vmonitor ntpd: Listening on interface lo, 127.0.0.1#123 vmonitor ntpd: Listening on interface eth0, 172.16.15.39#123 vmonitor ntpd: kernel time sync status 0040 vmonitor ntpd: kernel time sync status 0040 lami20j@debian:~$