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!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...