fieldformat doesn't change the value of the field, it just changes the way the field is display. Change it to
| eval current=strftime(current,"%H:%M")
| eval _time=_time+(15*30)-1
| bin _time span=15m
| fieldformat _time=strftime(_time,"%H:%M")
it works fine but i need to do the same thing from the currnt time...
| eval current=now()+(15*30)-1
| bin current span=15m
| fieldformat current=strftime(current,"%H:%M")
it seems to be what I need
but when I compare the current time with the past time (see my where clause) it displays nothing
`index` sourcetype="session" earliest=-7d@d+7h latest=-7d@d+19h
| bin _time span=15m
| eval time=strftime(_time,"%H:%M")
| stats dc(s) as s by time
| eval current=now()+(15*30)-1
| bin current span=15m
| fieldformat current=strftime(current,"%H:%M")
| where time=current
| table s time current
it's strange because I can see data on the same slot time
fieldformat doesn't change the value of the field, it just changes the way the field is display. Change it to
| eval current=strftime(current,"%H:%M")
perfect ITWhisperer, thanks
Remainder=Time % 900
Time=Time-Remainder
If Reminder >=450 then Time=Time+900
You can do each step here with the splunk Eval command.
Time needs to be in Unix: here the docs to help with that https://docs.splunk.com/Documentation/SCS/current/SearchReference/DateandTimeFunctions
Hi
So if i well understand i cant have a date in H:M: format?
you can use the functions, strftime and strptime to change between formats.
you can read about them here.
https://docs.splunk.com/Documentation/SCS/current/SearchReference/DateandTimeFunctions