<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Rsyslog Log Rotation in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495778#M84534</link>
    <description>&lt;P&gt;@mydog8it, are you able to share your process and the script you are using? That would be helpful. &lt;/P&gt;</description>
    <pubDate>Sun, 26 Jan 2020 20:35:48 GMT</pubDate>
    <dc:creator>dillardo_2</dc:creator>
    <dc:date>2020-01-26T20:35:48Z</dc:date>
    <item>
      <title>Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495776#M84532</link>
      <description>&lt;P&gt;We need to rotate syslog files once they reach a certain size. &lt;BR /&gt;
Our directory structure looks like the following:&lt;/P&gt;

&lt;P&gt;/opt/splunk/syslog/datasource1&lt;BR /&gt;
/opt/splunk/syslog/datasource2 &lt;BR /&gt;
/opt/splunk/syslog/datasource3 &lt;/P&gt;

&lt;P&gt;etc. &lt;/P&gt;

&lt;P&gt;Once files in the source folders reach 1GB for example, we need them to be moved to /opt/splunk/old_files&lt;/P&gt;

&lt;P&gt;Has anyone successfully set up a rotation script? &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 16:37:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495776#M84532</guid>
      <dc:creator>dillardo_2</dc:creator>
      <dc:date>2020-01-24T16:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495777#M84533</link>
      <description>&lt;P&gt;We create a new file per device type every hour and throw away files in 72 hours.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jan 2020 19:32:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495777#M84533</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-01-24T19:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495778#M84534</link>
      <description>&lt;P&gt;@mydog8it, are you able to share your process and the script you are using? That would be helpful. &lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 20:35:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495778#M84534</guid>
      <dc:creator>dillardo_2</dc:creator>
      <dc:date>2020-01-26T20:35:48Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495779#M84535</link>
      <description>&lt;P&gt;the hourly rotation is by design is you name the log file in rsyslog with mylog-yearmonthday-hour.log&lt;BR /&gt;
(and that avoid any race condition as it is done directly by rsyslog)&lt;BR /&gt;
to purge, just add a simple script in /etc/cron.d/purgemylog.cron&lt;BR /&gt;
with hourly + run as a user who can delete log then run &lt;BR /&gt;
find /var/log/mylogdir  -type f -name \"mylog*.log\"-mtime +2 -delete&lt;BR /&gt;
if you want to keep them 2 days &lt;BR /&gt;
(or -mmin +xxx for more granularity)&lt;/P&gt;

&lt;P&gt;make sure you specify the directory and a filename form in your find command to avoid any bad surprise...&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jan 2020 21:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495779#M84535</guid>
      <dc:creator>maraman_splunk</dc:creator>
      <dc:date>2020-01-26T21:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495780#M84536</link>
      <description>&lt;P&gt;Refer this link:&lt;BR /&gt;
&lt;A href="https://www.tecmint.com/manage-linux-system-logs-using-rsyslogd-and-logrotate/"&gt;https://www.tecmint.com/manage-linux-system-logs-using-rsyslogd-and-logrotate/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 12:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495780#M84536</guid>
      <dc:creator>Jawahir</dc:creator>
      <dc:date>2020-01-27T12:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495781#M84537</link>
      <description>&lt;P&gt;Thanks, I did see this and have tried using logrotate. When we rotate the logs, they need to be moved to an archive folder outside of the syslog directory. When I add a command to move the files after postrotate, they files are moved successfully, but rsyslog stops working and must be restarted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;For example: 

/opt/splunk/syslog/*/*
 {
    daily
    missingok
    compress    
    notifempty    
    sharedscripts
    postrotate
                mv /opt/splunk/syslog/*/*.gz /opt/splunk/archive/;
    endscript
}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jan 2020 23:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495781#M84537</guid>
      <dc:creator>dillardo_2</dc:creator>
      <dc:date>2020-01-27T23:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rsyslog Log Rotation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495782#M84538</link>
      <description>&lt;P&gt;This works for us, but rsyslog stops processing data and has to be restarted. &lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2020 23:42:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Rsyslog-Log-Rotation/m-p/495782#M84538</guid>
      <dc:creator>dillardo_2</dc:creator>
      <dc:date>2020-01-27T23:42:59Z</dc:date>
    </item>
  </channel>
</rss>

