OPNsense Forum

English Forums => General Discussion => Topic started by: direx on May 23, 2019, 09:19:36 PM

Title: Question about log ordering (system.log)
Post by: direx on May 23, 2019, 09:19:36 PM
Hi,

I think this might be a general BSD question: I am wondering about the ordering of log entries in OPNsense. Could somebody explain this to me:

# cat /var/log/system.log | awk '{print $1 $2}' | uniq
600:14:56
May16
May17
May18
May19
May20
May21
May22
May23
rc.dyndns:Dynamic
May14
May15
May16
May1CLOG


What I don't understand is:


I am coming from Linux and I have never seen something this odd before. To me it looks like a corrupt file or filesystem, or is this normal?


Thanks,
direx
Title: Re: Question about log ordering (system.log)
Post by: franco on May 23, 2019, 09:26:10 PM
Hi direx,

Use "clog" instead of "cat". It's a circular log format of fixed size flushing out old entries for new ones. It's not a plain text file.


Cheers,
Franco
Title: Re: Question about log ordering (system.log)
Post by: direx on May 23, 2019, 10:09:18 PM
Hi Franco,

thanks for the explanation, that makes sense. I felt like a total Unix noob when first using less/grep/cat on these log files :D


- direx
Title: Re: Question about log ordering (system.log)
Post by: franco on May 24, 2019, 11:58:35 AM
It's non-obvious so no worries. We do have a bit of docs for this nowadays too. :)

https://docs.opnsense.org/manual/logging.html#circular-logs


Cheers,
Franco