Getting Data In

How to monitor a structured XML log file without indexing duplicate events?

schose
Builder

Hi forum,

I'm trying to monitor an xml structured logfile like this:

<Events>
<Event>line1</Events>
<Event>line2</Events>
</Events>

When a new event is coming in, the new logentry tag is attached one line before the end.

<Events>
<Event>line1</Events>
<Event>line2</Events>
<Event>line3</Events>
</Events>

When using monitor://, the logfile is re-read completely and I end up in doubled events for every new line. The message I see in splunkd.log on the forwarder is

Checksum for seekptr didn't match, will re-read entire file file='/logs/example.logs'

Workaround to get rid of the doubled events is to logrotate very often and read the rotated log, not the recent. The rotated log will not be extended so the problem doesn't occur.

Is there better way to monitor the recent log? Tried followTail = 1 , but didn't work out.

Best Regards,

Andreas

0 Karma
1 Solution
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...