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 😀

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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Introduction to Splunk AI

How are you using AI in Splunk? Whether you see AI as a threat or opportunity, AI is here to stay. Lucky for ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Maximizing the Value of Splunk ES 8.x

Splunk Enterprise Security (ES) continues to be a leader in the Gartner Magic Quadrant, reflecting its pivotal ...