Splunk Search

The starting time of search with timechart doesn’t match the local timezone.

kinaba_splunk
Splunk Employee
Splunk Employee

When bucket time is between 03/08/2018 00:00:00 and 03/08/2018 24:00:00 with JST (GMT+9) as timezone, the starting time of search doesn’t match the local timezone.

Example)

index=xxx | timechart count span=12h 

Expected result:
Starting time should be 03/08/2018 00:00:00 and then, +12h would be
03/08/2018 12:00:00.

Actual result:
Starting time gets 03/07/2018 15:00:00 and then, +12h would be
03/08/2018 03:00:00.

Could you tell me why?

0 Karma
1 Solution

kinaba_splunk
Splunk Employee
Splunk Employee

Span option is always rounding down the starting date (first bin) in a specific way by design.
Thus, there is no guarantee that start time bin used by timechart is corresponding to local timezone.

Even bucket time is between 03/08/2018 00:00:00 and 03/08/2018 24:00:00 based on certain timezone,
the start time of search doesn’t always match the same.

Workaround might be as below.

index=* | eval day=strftime(_time, "%u.%A")
| bucket date_hour span=12
| chart count by date_hour day

Enhancement request related with spap and timezone is below.
SPL-148967 Align the start of the first time bucket to the start time of a search.

View solution in original post

0 Karma

kinaba_splunk
Splunk Employee
Splunk Employee

Span option is always rounding down the starting date (first bin) in a specific way by design.
Thus, there is no guarantee that start time bin used by timechart is corresponding to local timezone.

Even bucket time is between 03/08/2018 00:00:00 and 03/08/2018 24:00:00 based on certain timezone,
the start time of search doesn’t always match the same.

Workaround might be as below.

index=* | eval day=strftime(_time, "%u.%A")
| bucket date_hour span=12
| chart count by date_hour day

Enhancement request related with spap and timezone is below.
SPL-148967 Align the start of the first time bucket to the start time of a search.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...