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!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...