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
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...