LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-13-2023, 01:19 AM   #1
motwane
LQ Newbie
 
Registered: Dec 2023
Posts: 1

Rep: Reputation: 0
Using rsyslog on Debian to store firewall logs - issues with logrotate


Hi,

I am trying to store firewall logs on a Debian machine via rsyslog.

The configuration works - logs are being received in the configured file -
Code:
/var/log/fwlogs/fw.log
The plan is to rotate the logs on a daily basis using logrotate, the /etc/logrotate.d/fw file is:

Code:
/var/log/fwlogs/fw.log {
    daily
    rotate 30
    copytruncate
    dateext
    compress
    dateformat -%Y-%m-%d-%H%M%S
    olddir /var/log/fwlogs/old
    postrotate
        /usr/lib/rsyslog/rsyslog-rotate
    endscript
}

I did try checking the configuration with

Code:
# logrotate --debug --verbose /etc/logrotate.conf
and nothing seems amiss...

Code:
rotating pattern: /var/log/fwlogs/fw.log  after 1 days (30 rotations)
olddir is /var/log/fwlogs/old, empty log files are rotated, old logs are removed
considering log /var/log/firewall/firewall.log
  Now: 2023-12-13 12:44
  Last rotated at 2023-12-13 00:00
  log does not need rotating (log has been rotated at 2023-12-13 00:00, which is less than a day ago)
But logs weren't rotated as the text in bold above would have us believe:

Code:
~# stat /var/log/fwlogs/fw.log
  File: /var/log/fwlogs/fw.log
  Size: 42086802824     Blocks: 82200816   IO Block: 4096   regular file
Device: 259,2   Inode: 4068299     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2023-12-13 12:46:06.147399605 +0530
Modify: 2023-12-13 12:46:06.143399587 +0530
Change: 2023-12-13 12:46:06.143399587 +0530
 Birth: 2023-12-12 15:21:29.754243156 +0530
If all goes as per plan, a new logfile would be created every midnight, the log file from the previous day would be moved a directory named old within the logs directory.

Well, things aren't going as per plan and logrotation isn't working at the moment and i am hoping get help on this here
 
Old 12-14-2023, 03:41 PM   #2
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,628

Rep: Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557Reputation: 2557

"/var/log/firewall/firewall.log" is not "/var/log/fwlogs/fw.log" ...

 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsyslog - Ratelimit , is there a way to just limit inetad of stopping rsyslog after sometime ? dr.x Linux - Security 1 02-12-2022 11:04 AM
[rsyslog] how to get the original IP address in rsyslog relay chain wolf4666 Linux - Software 4 10-18-2018 09:17 AM
[SOLVED] Every two minutes rsyslog outputs - rsyslogd: action 'action 3' resumed (module 'builtin:omfile') [v8.32.0 try http://www.rsyslog.com/e/2359 Toadman Linux - Software 9 09-01-2018 12:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:44 PM.

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