1753444 Members
4725 Online
108794 Solutions
New Discussion юеВ

ascii or flat files

 
SOLVED
Go to solution
Shivkumar
Super Advisor

ascii or flat files

Dear Sirs,

Are various types of logs for applications like oracle, web servers, web logic servers and operating systems etc ascii or flat files ?

Thanks,
Shiv
11 REPLIES 11
Arunvijai_4
Honored Contributor

Re: ascii or flat files

Hi Shiv,

Most of OS related log files are ascii texts. As you can see from here,

Myserver:>file /var/adm/syslog/*
/var/adm/syslog/OLDsyslog.log: ascii text
/var/adm/syslog/mail.log: ascii text
/var/adm/syslog/syslog.log: ascii text

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: ascii or flat files

Based on application it will differ. You can check the file type with file command.

file

will give that information.

--
Muthu
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: ascii or flat files

Hi Shiv,

If you want to know more about flat files,

http://databases.about.com/cs/administration/g/flatfile.htm
http://www.webopedia.com/TERM/F/flat_file.html

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Devender Khatana
Honored Contributor

Re: ascii or flat files

Hi,

Most of the files are ascii text files only. I do not remember any application's log file to be a binary file. Moreover you can check this using

#file filename

HTH,
Devender
Impossible itself mentions "I m possible"
Steven E. Protter
Exalted Contributor
Solution

Re: ascii or flat files

Shalom Shiv, logs are almost all ascii text.

To see what type a file is use the "file" command.

It keeps me out of trouble on a regular basis.

There are products that produce binary logs, such as /var/adm/btmp and /var/adm/wtmp

Never assume.

Hope you are well Sir.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Muthukumar_5
Honored Contributor

Re: ascii or flat files

file command is getting file type informations based on /etc/magic file. See /etc/magic file and it's contents. Which will give you all.

--
Muthu
Easy to suggest when don't know about the problem!
James R. Ferguson
Acclaimed Contributor

Re: ascii or flat files

Hi Shiv:

Aside from binary executable files generated by compilers and linkers, the UNIX philosophy is to employ ASCII files for as many things as it can.

The idea is that a file should be easily read by a human; easily edited; and easily parsed.

Binary files are not human-readable and require specific knowledge of their structure to parse and/or update. In many cases, a specific tool (program) must be written to specifically manipulate each binary file.

Hence, you can expect log files for applications like Oracle, Apache, etc. to be simple ASCII stream data.

Regards!

...JRF...
Chan 007
Honored Contributor

Re: ascii or flat files

Shiv,

Both flat and ascii files are more oe less the same.

In fact flat files are those which are imported from other documents like work/xls. Where they will remove all your bold, underlines etc.

But OS users all log files in ascii format. As that are viewable and editable.

Chan
Arturo Galbiati
Esteemed Contributor

Re: ascii or flat files

Hi,
you can see teh type of teh file (ascii/binary) using the command file.
In case of binary you can try to read something using strings binary_log_file.
HTH,
Art