Splunk Search

problem with span command in splunk 7.2

09128028400
Engager

Hello every body
I have been struggling with a serious problem recently 
my splunk version is 7.2 
when I use  span Command (with tstats or bin ) , it starts from half hour ! instead of hour
for example :
| tstats count as count from datamodel=Log where Log.FinalStatus!=61  by  _time span=1h


I have picture below as result , while I want time sections like 10 , 11, 12 ...

09128028400_0-1639469153967.png

 

what should I do ??
Thank you

Labels (1)
Tags (4)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Does something like this work for you?

| tstats count as count from datamodel=Log where Log.FinalStatus!=61  by  _time span=30m
| eval _time=_time-30*60
| bin _time span=1h
| eval _time=_time+30*60
| stats sum(count) as count by _time

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Which timezone are you in?

0 Karma

09128028400
Engager

Hi 
+3:30

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Does something like this work for you?

| tstats count as count from datamodel=Log where Log.FinalStatus!=61  by  _time span=30m
| eval _time=_time-30*60
| bin _time span=1h
| eval _time=_time+30*60
| stats sum(count) as count by _time
0 Karma

09128028400
Engager

It works 🙂
thank you 🙂
but do you know any solution to resolve this problem ? 
I mean , every time this sections starts from hour , not half hour  

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

_time is usually stored as number of second since start of epoch in utc - all span does is that the time value back to the start of the current time bucket (still in utc). When you display the time it is local format, hence the half hour boundary differences in your case. You could try displaying your times in utc or potentially make the adjustment when the events are indexed or petition your government to change their time zone settings so they align with hours rather than half past or move 😀

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Internally Splunk is using UTC time and you have shift from it 3,5h which is used when splunk shows times.
Probably the best option is ask from splunk support if there haven't been any Indians who can help you (if I recall right at least Pune has this timezone)?
0 Karma
Get Updates on the Splunk Community!

Combine Multiline Logs into a Single Event with SOCK - a Guide for Advanced Users

This article is the continuation of the “Combine multiline logs into a single event with SOCK - a step-by-step ...

Everything Community at .conf24!

You may have seen mention of the .conf Community Zone 'round these parts and found yourself wondering what ...

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...