<?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: script in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756119#M23539</link>
    <description>&lt;P&gt;This isn't really a Splunk question, it is a scripting question. Which scripting language do you want to use (there are many to choose from)?&lt;/P&gt;</description>
    <pubDate>Wed, 03 Dec 2025 05:56:43 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2025-12-03T05:56:43Z</dc:date>
    <item>
      <title>script to rotate log files ?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756116#M23538</link>
      <description>&lt;P&gt;I want to create a script for log rotation in splunk , which makes a zip file of last 3 days (individual zip files) ,so every new day it will make a new zip file and if the count of zip files is greater than 3 then it should delete oldest zip file so that count of zip file remains 3 only. because we only want zip file of last 3 days only. There is a main file which is storing logs everyday&amp;nbsp; (file name: firewall) and the script will be schedule like 1 am everyday.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2025 14:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756116#M23538</guid>
      <dc:creator>SN1</dc:creator>
      <dc:date>2025-12-03T14:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756119#M23539</link>
      <description>&lt;P&gt;This isn't really a Splunk question, it is a scripting question. Which scripting language do you want to use (there are many to choose from)?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2025 05:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756119#M23539</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2025-12-03T05:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756125#M23540</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274807"&gt;@SN1&lt;/a&gt;&amp;nbsp;try the below log rotation script, modify the file log file name based on yours and setup the cron schedule based on your requirement.&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;BR /&gt;# Compress files &amp;gt;1 day old&lt;BR /&gt;find "&amp;lt;path of log file location&amp;gt; -iname "firewall-*.log" -type f -mtime +1 -exec gzip {} \;&lt;/P&gt;&lt;P&gt;# Delete .gz files &amp;gt;3 days old&lt;BR /&gt;find &amp;lt;path of log file location&amp;gt; -name "firewall-*.log.gz" -type f -mtime +3 -exec rm {} \;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know if you are facing any issues.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2025 08:24:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756125#M23540</guid>
      <dc:creator>thahir</dc:creator>
      <dc:date>2025-12-03T08:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: script</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756136#M23541</link>
      <description>&lt;P&gt;Please don't share "ready to use" scripts based on serious assumptions without at least explaining what those assumptions are.&lt;/P&gt;&lt;P&gt;In here your quite strong assumption is that there would be no files matching firewall-*.log.gz coming from other sources (possibly in other subdirectories.&lt;/P&gt;&lt;P&gt;Also - you're mixing -name with -iname.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Dec 2025 19:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/script-to-rotate-log-files/m-p/756136#M23541</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-12-03T19:57:47Z</dc:date>
    </item>
  </channel>
</rss>

