Menu

#37 Solution to make DATE work

open
nobody
None
5
2003-10-13
2003-10-13
Anonymous
No

In my log, iptables appears like that:
Oct 13 20:30:40 localhost kernel: [IPTABLES ACCEPT]

But in feed_db.pl, the lines
for $month_nb (0..11) {
$m{strftime("%b", 0, 0, 0, 1, $month_nb, 96)}=sprintf
("%02d",$month_nb+1);
}
generate this table:
m[jan]=01
m[fev]=02
...
m[oct]=10
and so on.

So the line:
$entry{'date'}="$year-".$m{shift(@entry_split)}."-".shift
(@entry_split)." ".shift(@entry_split);
tries to find the entry m[Oct]. it does not exist: m[Oct]
is not the same as m[oct].

The solution is to replace the line (# 59):
$m{strftime("%b", 0, 0, 0, 1, $month_nb, 96)}=sprintf
("%02d",$month_nb+1);
with this line:
$m{lc(strftime("%b", 0, 0, 0, 1, $month_nb, 96))}
=sprintf("%02d",$month_nb+1);

and the line (# 107):
$entry{'date'}="$year-".$m{shift(@entry_split)}."-".shift
(@entry_split)." ".shift(@entry_split);
with this line:
$entry{'date'}="$year-".$m{lc(shift(@entry_split))}."-
".shift(@entry_split)." ".shift(@entry_split);

the lc function converts a string to lower case.

I hope it will help.
Seld.

Discussion


Log in to post a comment.

Auth0 Logo