Getting Data In

How to use the last import for my source?

chadman
Path Finder

I have a file that gets imported every time it changes. Each line in the file shows up as an event and I want to use data only from the last import. So each import might have 200 events, but I only want to see those 200 and none from previous imports. I have tried this and it looks like it works, but had an issue with it once when the data was large and it did not all import at the excat same time stamp. Because of this some of the data was missing.

| eventstats latest(_time) AS Current | where _time=Current
0 Karma
1 Solution

Sukisen1981
Champion

what happens if you try this?

| eventstats max(_time) AS Current | where _time=Current

View solution in original post

Sukisen1981
Champion

what happens if you try this?

| eventstats max(_time) AS Current | where _time=Current

chadman
Path Finder

Thanks! that worked!

0 Karma

somesoni2
Revered Legend

@chadman,

Glad you issue was resolved by @Sukisen's answer. Do remember to close the question by accepting the same.

0 Karma
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 ...