Splunk Search

Convert _time Timezone at Search Time

bcarr12
Path Finder

Some of the logs I am consuming have time stamps in GMT while my overall logging infrastructure is in EST. I am trying to do a comparison between the GMT timestamp in one log and the current time in EST. Is there any way to convert _time from EST to GMT using something like strftime at searchtime, so it can be more easily worked with? I understand there is a way to do this "overall" in Splunk, but I am more interested in doing a "one-off" timezone conversion if possible.

0 Karma

bmacias84
Champion

The best thing to do is set your time zone in your props file for each of your sources by sourcetype, host, or source. Then set your users time zone and Splunk will handle the rest, example below. The other option is to user strptime and strftime to do the math yourself.


#props.conf
[host::nyc*]
sourcetype = foo
SHOULD_LINEMERGE = True
TZ = US/Eastern

0 Karma

yannK
Splunk Employee
Splunk Employee

If the event has the wrong timestamp.timezone, it will never match your search time window. And you cannot change the TZ once indexed.
So use the previous method and reindex with a TZ.

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...