OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Question about log ordering (system.log)
« previous next »
  • Print
Pages: [1]

Author Topic: Question about log ordering (system.log)  (Read 2111 times)

direx

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Question about log ordering (system.log)
« 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:

Code: [Select]
# 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:

  • Why is the most current log entry not the last line in the file?
  • Why does the ordering change somewhere right in between the file? It goes from May 23 to May 14.

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
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Question about log ordering (system.log)
« Reply #1 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
Logged

direx

  • Newbie
  • *
  • Posts: 17
  • Karma: 1
    • View Profile
Re: Question about log ordering (system.log)
« Reply #2 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
Logged

franco

  • Administrator
  • Hero Member
  • *****
  • Posts: 17707
  • Karma: 1618
    • View Profile
Re: Question about log ordering (system.log)
« Reply #3 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
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • General Discussion »
  • Question about log ordering (system.log)
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2