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!

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

March Community Office Hours Security Series Uncovered!

Hello Splunk Community! In March, Splunk Community Office Hours spotlighted our fabulous Splunk Threat ...

Stay Connected: Your Guide to April Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars in April. This post ...