Getting Data In

How can we get the logs generated only in an indicated period?

xiyangyang
Path Finder

we need take the logs generated from 00:00 ~8:00 under one folder (for example: folder /a/).
Under /a/, there are several log files. For example: a.log, b.log.
a.log is generated from 00:00~8:00, but b.log is not.
We set input.conf as follow and start the log acquasition from 0:00 and stop it at 8:00 everyday:
      [monitor:///a/*]
      disabled = false
      sourcetype = xxxxx
      index = ssss
      followTail = 1
      ignoreOlderThan = 1d
Under this settings, we got both a.log and b.log. however, b.log is not the target,

How can we get the log which generated in the correct period only?
We cannot use white list or black list, because there are a lot of logs.

Tags (2)
0 Karma

esix_splunk
Splunk Employee
Splunk Employee

If the names of the logs are truly random, and cant apply a whitelist / blacklist, then you really cant do much except the monitor the whole directory.

Whitelisting the filenames would be the best method to approach this.

If you are not looking at realtime monitoring of these files, then you might be better to work on a scripted solution that will move only the desired logs to a separate folder and have splunk monitor that directory.. That does require some scripting outside of Splunk though...

Is this a custom app?

0 Karma

xiyangyang
Path Finder

we don't know exactly the name fo logs. The logs generate every day.

0 Karma

esix_splunk
Splunk Employee
Splunk Employee

If you know which logs these are, you can create an input for the specific files. That is probably the best way to accomplish this..


[monitor:///a/a.log]
sourcetype = alog
index = ssss
followTail = 1
ignoreOlderThan = 1d

[monitor:///a/b.log]
sourcetype = blog
index = ssss
followTail = 1
ignoreOlderThan = 1d

[monitor:///a/c.log]
sourcetype = clog
index = ssss
followTail = 1
ignoreOlderThan = 1d

You can also leave in the monitor glob for the whole directory, after these specific inputs...

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...