Splunk Search

Query for different timezones

alucaferro
Engager

I have imported data with daytime in GMT time zone.

I need count events group by on variable interval (day,week or month) . I use a search query like this:

<mysearch>|
bucket _time span=1d | stats count as newUsersForPerido by _time

And this return counts over every day on GMT timezone.

Now I need to use this query in different time zones for example UTC+03:00 and UTC-04:00 how I can modify my search string?

0 Karma
1 Solution

woodcock
Esteemed Legend

The easiest way is just to adjust _time like this:

... | eval _time = _time + (3*60*60) | bucket _time span=1d | stats count as newUsersForPerido by _time

Be sure to also adjust your timepicker to be 3 hours earlier on both sides so you pull in the correct events.

View solution in original post

woodcock
Esteemed Legend

Also, you can adjust your user settings at Your User Name -> Edit account -> Time zone to put in different values. This setting controls the normalization of the timepicker when you pick settings that are date-relative (e.g. Today, Last 7 days, etc.).

0 Karma

woodcock
Esteemed Legend

The easiest way is just to adjust _time like this:

... | eval _time = _time + (3*60*60) | bucket _time span=1d | stats count as newUsersForPerido by _time

Be sure to also adjust your timepicker to be 3 hours earlier on both sides so you pull in the correct events.

sundareshr
Legend

In which timezone are the events generated? Are they all GMT?

http://docs.splunk.com/Documentation/Splunk/latest/data/Applytimezoneoffsetstotimestamps

0 Karma

alucaferro
Engager

Yes all events are generetad in GMT

0 Karma
Get Updates on the Splunk Community!

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

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...