LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-11-2024, 11:17 AM   #1
lostintime
Member
 
Registered: Dec 2021
Posts: 204

Rep: Reputation: Disabled
Linux logs: ^@^@^@^@


Long ago in a galaxy far away I ran into an explanation about lines in logs that are nothing but repeated ^@^@^@ characters. Sadly I never copied that explanation into my notes. Searching for related discussions these days seems futile.

My guess is the characters are escaped characters that render as ^@^@^@ in text viewers.

* What causes these obscure log entries?
* Is there a way to search logs for these obscure characters?

Often these log entries are discovered when using grep with a response the "binary file matches."

Thanks.
 
Old 05-11-2024, 11:26 AM   #2
metaed
Member
 
Registered: Apr 2022
Location: US
Distribution: Slackware64 15.0
Posts: 372

Rep: Reputation: 172Reputation: 172
Messages were logged, which extended the length of the logfile. But the system crashed before the filesystem cache was written to the physical drive. Consequently, after a reboot, the logfile contains 0-bytes (rendered as ^@) where the messages would have been. This is the scenario in which I encountered the problem.
 
1 members found this post helpful.
Old 05-11-2024, 11:27 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 970

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Pressing control key subtracts 0x40 from the ASCII code, code of "@" is 0x40, so ^@ is 0x00 - these are zero (0x00) characters (which usually indicates some sort of file corruption).
 
Old 05-11-2024, 12:07 PM   #4
lostintime
Member
 
Registered: Dec 2021
Posts: 204

Original Poster
Rep: Reputation: Disabled
Quote:
But the system crashed before the filesystem cache was written to the physical drive.
That makes some sense. I have seen these characters in syslog, but today I found the characters in maillog. The time stamps in the maillog indicate no system crash. Perhaps I had restarted sendmail at that point but one would think stopping the service would be graceful.

Quote:
the logfile contains 0-bytes (rendered as ^@)
Quote:
so ^@ is 0x00 - these are zero (0x00)
That info led me to change my search criteria. These weird log entries are null characters?

Quote:
which usually indicates some sort of file corruption
Yeah, I can understand this happening once in a blue moon with syslog, but maillog? Kind of weird.

So how to find the exact line in the affected log with these corrupt strings? Looks like the following might succeed:

grep -Pna '\x00'

Last edited by lostintime; 05-11-2024 at 12:16 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Back up logs file and create a script showing the backed up logs and the running logs Billy_6052 Programming 5 12-13-2014 02:32 AM
Finding LDAP Server Logs / Application Logs in Linux arbignay Linux - Newbie 2 03-24-2008 09:54 AM
Firefox logs user out? Where are error logs? case1984 Linux - General 0 10-09-2004 02:22 PM
Separate firewall logs and general logs dominant Linux - General 3 04-20-2004 01:26 AM
Apache logs - ???Linux logs??? mylo2003 Linux - General 3 08-07-2003 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration