Topic: Logfile format

Hi, nice utility. Two questions: is it possible to log the size of the file transfer to the logfile? Most FTP servers would do that. Secondly, could someone explain each field of the log file?

Thanks,
BS

Re: Logfile format

Hi,

1/ At this time you can't change anything in the log file sad ... should be improved in the future ! wink

2/ Sample:

2008-02-16 18:20:30 [42]My message.

Format
"2008-02-16 18:20:30" -> Date (year-month-day hours-minutes-seconds)
"42" -> Pid of MySecureShell (help to follow one session of a user)
"My message." -> Text of the events smile


Best regards,
MySecureShell Team.

3 (edited by fabrozor 2008-06-28 11:20:19)

Re: Logfile format

pareil pour moi

oups,

same for me.

I have to set up a specific logfiles analyser --> AwStats ( http://awstats.sourceforge.net )
This logfiles analyser config file, can be modified to match some logfile formats. But there are some required fields as :
- code
- bytesd
- methodurl (or method)

for exemple i tryed to modify AwStats to match MySecureShell log format but i could not do something less than this 

LogFormat="%time2 %code %logname %host %methodurlnoprot %bytesd"

The problem is i get a perl error when i launch the AwStats.pl perl script because i think i can't handle the final ^[37:40:0m
But this is probably not this because i tried to edit the log file and replace all the ^[37:40:0m with "0000" and it said the same error about no more existing ^[37:40:0m !!!??

http://img510.imageshack.us/img510/5755/awstatsperlerrorbn0.th.jpg

So i am very interrested to be able to modify the MySecureShell log format to make the both "MySecureShell" and "AwStats" work together.

Exemple of my MySecureShell logfile

2008-05-12 16:17:52 [32:40:1m[2304]New client [nathalie] from [192.168.0.2][37:40:0m
2008-05-12 14:18:32 [31:40:1m[2304][nathalie][192.168.0.2]Try to create directory '/projet-25' : success[37:40:0m
2008-05-12 16:20:52 [32:40:1m[2310]New client [nathalie] from [192.168.0.2][37:40:0m
2008-05-12 14:20:52 [34:40:1m[2310][nathalie][192.168.0.2]Upload into file '/projet-25/P25-52.JPG'[37:40:0m
2008-05-12 16:20:52 [32:40:1m[2312]New client [nathalie] from [192.168.0.2][37:40:0m
2008-05-12 16:20:52 [34:40:1m[2312][nathalie][192.168.0.2]Upload into file '/projet-25/P25-53.JPG'[37:40:0m
2008-05-12 14:20:53 [34:40:1m[2310][nathalie][192.168.0.2]Upload into file '/projet-25/P25-54.JPG'[37:40:0m
2008-05-12 16:20:53 [34:40:1m[2312][nathalie][192.168.0.2]Upload into file '/projet-25/P25-49.JPG'[37:40:0m
2008-05-12 14:20:54 [34:40:1m[2310][nathalie][192.168.0.2]Upload into file '/projet-25/P25-50.JPG'[37:40:0m
2008-05-12 16:20:54 [34:40:1m[2312][nathalie][192.168.0.2]Upload into file '/projet-25/P25-51.JPG'[37:40:0m
2008-05-12 14:21:03 [32:40:1m[2304][nathalie][192.168.0.2]Quit.[37:40:0m

Re: Logfile format

Hi,

Try to recompile MySecureShell with:

./configure --with-logcolor=no
make
./install.sh fr

wink

fabrozor wrote:

pareil pour moi

oups,

same for me.

I have to set up a specific logfiles analyser --> AwStats ( http://awstats.sourceforge.net )
This logfiles analyser config file, can be modified to match some logfile formats. But there are some required fields as :
- code
- bytesd
- methodurl (or method)

for exemple i tryed to modify AwStats to match MySecureShell log format but i could not do something less than this 

LogFormat="%time2 %code %logname %host %methodurlnoprot %bytesd"

The problem is i get a perl error when i launch the AwStats.pl perl script because i think i can't handle the final ^[37:40:0m
But this is probably not this because i tried to edit the log file and replace all the "^[37:40:0m" with "0000" and it said the same error about no more existing "^[37:40:0m" !!!??

http://img510.imageshack.us/img510/5755 … bn0.th.jpg

So i am very interrested to be able to modify the MySecureShell log format to make the both "MySecureShell" and "AwStats" work together.

Exemple of my MySecureShell logfile

2008-04-14 19:16:24 [32:40:1m[2258]New client [alain] from [192.168.0.2][37:40:0m
2008-04-14 17:21:25 [32:40:1m[2258][alain][192.168.0.2]Connection time out[37:40:0m
2008-04-14 17:21:25 [32:40:1m[2258][alain][192.168.0.2]Quit.[37:40:0m
2008-04-14 19:52:13 [32:40:1m[2395]New client [alain] from [192.168.0.2][37:40:0m
2008-04-14 17:52:17 [32:40:1m[2395][alain][192.168.0.2]Quit.[37:40:0m
2008-04-14 20:01:18 [32:40:1m[2425]New client [alain] from [192.168.0.2][37:40:0m
2008-04-14 20:01:25 [32:40:1m[2425][alain][192.168.0.2]Quit.[37:40:0m
2008-04-14 20:02:54 [32:40:1m[2441]New client [alaintest] from [192.168.0.2][37:40:0m
2008-04-14 18:07:14 [32:40:1m[2441][alaintest][192.168.0.2]Quit.[37:40:0m
2008-04-14 20:30:16 [32:40:1m[2642]New client [alain] from [192.168.0.2][37:40:0m
2008-04-14 20:30:16 [31:40:7m[2642][alain][192.168.0.2]Couldn't go to home '/CHROOT_RSSH/home/alain' : No such file or directory[37:40:0m
2008-04-14 20:30:16 [31:40:7m[2642][alain][192.168.0.2]Couldn't chroot : No such file or directory[37:40:0m
2008-04-14 20:35:17 [32:40:1m[2642][alain][192.168.0.2]Quit.[37:40:0m

5 (edited by fabrozor 2008-06-28 11:24:44)

Re: Logfile format

ok i'll try that
thank you big_smile

6 (edited by fabrozor 2008-06-28 11:40:39)

Re: Logfile format

Hello again.

(AwStats logfile analyser is on a windows client
(MySecureShell server is on a debian

I just checked and i saw i installed from a package.

/var/cache/apt/archives/mysecureshell_1.0_i386.deb

How can i recompile from a package ? (sorry i am a newbinux)

edit :

I found that --> http://mysecureshell.sourceforge.net/fr … #question2
But i wonder if i must uninstall the package i installed before reinstalling from compiled sources.

Re: Logfile format

Problem :

I compiled --with-logcolor=no and it compiled with yes :-/

http://img174.imageshack.us/img174/6789/msscompilationwz2.th.jpg

8 (edited by fabrozor 2008-06-28 13:21:07)

Re: Logfile format

another problem, the logs.

Before recompiling, i made a

cp /var/log/sftp-server.log /var/log/sftp-server.log_old
> /var/log/sftp-server.log

to empty them.

To compile i became root in my "/root/mysecureshell_1.0/" directory (.tar.gz archive i uncomressed)
i compiled with :

./configure --with-logfile=/var/log/sftp-server.log --with-logcolor=no
make all

After recompiling, i made :

cp -f MySecureShell /bin/MySecureShell && chmod 755 /bin/MySecureShell

I perform some sftp actions, but my logs remains desperatly empty.

something's broken sad

Re: Logfile format

Ok it's almost fixed.
I forgot to make a

make install

Well, the problem remains that it's still in color logged.
http://img374.imageshack.us/img374/1241/colorloggedpg0.th.jpg

Re: Logfile format

fabrozor wrote:

Problem :

I compiled --with-logcolor=no and it compiled with yes :-/

http://img174.imageshack.us/img174/6789 … wz2.th.jpg

Sorry smile, it's :

./configure --without-logcolor=yes

Re: Logfile format

i mean't "./configure" too but with color at "no" it didn't work. My logs are colored.

Re: Logfile format

Hi,

After "./configure", just edit "config.h" and find the line with "HAVE_LOG_IN_COLOR" and delete it wink

Re: Logfile format

Thank you teka, i'll try that.