Monitoring Splunk

How to increase the number of internal logs retained on local server

coleman07
Path Finder

I want to keep more than 5 copies of eventgen.log. The log file is located in /opt/splunk/var/log/splunk, but is not one of the standard log files. How do I configure Splunk to keep more copies of this file? It looks like $SPLUNK_HOME/etc/log.cfg has specific lines for each log file and I don't know what to add to this file to manage eventgen.log.

0 Karma

Jeremiah
Motivator

I'm not sure that you can modify that setting in the log.cfg file. You can easily change it directly in the code though. In SA-Eventgen/lib/eventgenconfig.py, change the value of backupCount on line 402:

    fileHandler = logging.handlers.RotatingFileHandler(os.environ['SPLUNK_HOME'] + '/var/log/splunk/eventgen.log', maxBytes=25000000, backupCount=5)
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...