Splunk Search

Can you help me with a query that uses the latest function with a timechart command?

james_n
Path Finder

HI,

I have a query index=something | timechart latest(fieldA) as datavalues by dataNames.

when i select the time duration Today or Yesterday up to last 30days , it's working fine. If I select the last 3 months, it's displaying the wrong results.

Can you please help me on this?

0 Karma

bjoernjensen
Contributor

Hey,

How do you select "last 3 months"? Do you use any time snapping:
timechart_time_snipping

you can force the time using earliest and latest as filter:
index=something earliest=-3mon latest=now

Which is different to:
index=something earliest=-3mon@m latest=@m

Cheerz,
Björn

0 Karma

james_n
Path Finder

@skoelpin yes same data same timestamp from last one year onwards

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Can you post a screenshot of what you see and explain what you're looking to get?

Are you referring to different time spans as you extend the time period?

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Have you confirmed your timestamp is correct from 3 months ago?

0 Karma

adonio
Ultra Champion

timechart has auto spaning depends on the time picker
see here: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/timechart

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