Getting Data In

How to get last 1 week or current logs for inputs.conf

NightShark
Path Finder

Greetings, 

I have set the following configuration stanza on my inputs.conf but I am getting failures for using ignoreOlderThan key because it is a Windows related monitor path and apparently is not accepted.

[WinEventLog://Microsoft-Windows-DNSServer/Audit]
sourcetype = MSAD:NT6:DNS
disabled = 0
whitelist1 = EventCode="537"
ignoreOlderThan = 7d
index = test

I only want the latest amount x days of logs to be indexed instead of going for the oldest logs in the hosts. Is this possible? Indexing of current logs after server class reload is also an option but haven't found out how.

Thanks,

Regards,

Labels (4)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

Yep.

current_only = <boolean>
* Whether or not to acquire only events that arrive while the instance is
  running.
* If you set this setting to 1, the input only acquires events that arrive
  while the instance runs and the input is enabled. The input does not read
  data which was stored in the Windows Event Log while the instance was not
  running. This means that there will be gaps in the data if you restart the
  instance or experiences downtime.

 

View solution in original post

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Unfortunately, as you said - IgnoreOlderThan is an option only for monitor:// type inputs (file inputs).

Windows event logs are ingested by modular input (external tool) and are limited only to options provided by this tool. So you can either ingest events from the whole log or set current_only and make the forwarder wait for new events after restart. There is no option for a given "backlog" to read. If you believe it would be useful you can propose idea for such functionality at https://ideas.splunk.com/

0 Karma

NightShark
Path Finder

Thank you for the response,

So from my understanding setting current_only only indexes logs after restarting the universal forwarder and nothing before, correct?

Regards,

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Yep.

current_only = <boolean>
* Whether or not to acquire only events that arrive while the instance is
  running.
* If you set this setting to 1, the input only acquires events that arrive
  while the instance runs and the input is enabled. The input does not read
  data which was stored in the Windows Event Log while the instance was not
  running. This means that there will be gaps in the data if you restart the
  instance or experiences downtime.

 

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!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...