Splunk Search

How to change the index time as filename timestamp?

Borntowin
Loves-to-Learn Everything

Hi Team,

   I have indexed the file as current timestamp but would like to execute the query by taking the filename timestamp as _time will that be possible now? if yes, how do we do that.

Labels (1)
0 Karma

dhirendra761
Contributor

@Borntowin 

|eval _time=timestamp
0 Karma

PickleRick
SplunkTrust
SplunkTrust

You can overwrite the _time field at any point in your search pipeline. Just remember that it's supposed to be a numeric field containing number of seconds since epoch.

For example,

index=aaa | streamstats count as _time

will make your results start at Jan 1st 1970 at midnight and will "trickle" your events one per second.

One caveat though - since the _time field would be re-set later in the process, you can't use this value for initial timerange selection. (You can add conditions on time later in the SPL though).

0 Karma

gcusello
SplunkTrust
SplunkTrust
0 Karma
Get Updates on the Splunk Community!

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...