Splunk Search

Can't get results using _time in my search

TheJagoff
Communicator

I performed this search

index=* source="WinEventLog:System" EventCode=3 host=jj1 | table host, _time, message

and get the following results:

jj1 2016-05-02 18:27:04 Service started.
jj1 2016-05-02 18:23:55 VMCI: Using capabilities (0xc).

I want to narrow this down with the following search

index=* source="WinEventLog:System" EventCode=3 host=jj1 _time>="2016-05-02 18:27:04" |table host, _time, Message

I receive no results. Please advise on how to make this work.

Many thanks.

0 Karma
1 Solution

woodcock
Esteemed Legend

Check out the fieldformat command. Splunk automatically calls this inside every search so that, even though _time is actually a time_t and an integer, it is displayed to the user in his location-adjusted preference (in most cases, en_us). So your search should be:

index=* source="WinEventLog:System" EventCode=3 host=jj1 _time>= [|noop|stats count AS myTime | eval myTime = "2016-05-02 18:27:04" | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(myTime) | return $myTime] |table host _time Message

View solution in original post

0 Karma

woodcock
Esteemed Legend

Check out the fieldformat command. Splunk automatically calls this inside every search so that, even though _time is actually a time_t and an integer, it is displayed to the user in his location-adjusted preference (in most cases, en_us). So your search should be:

index=* source="WinEventLog:System" EventCode=3 host=jj1 _time>= [|noop|stats count AS myTime | eval myTime = "2016-05-02 18:27:04" | convert timeformat="%Y-%m-%d %H:%M:%S" mktime(myTime) | return $myTime] |table host _time Message
0 Karma

TheJagoff
Communicator

THANK YOU!!!!!

0 Karma

sundareshr
Legend

_time is always in epoch time. Here is some information how you can use time modifiers to filter you data by time.

http://docs.splunk.com/Documentation/Splunk/6.0.6/SearchReference/SearchTimeModifiers

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...