I think I hit this weirdness as well - this is from Windows system event logs isn't it? I wanted to check how well (or not) our NTP system was working.
I used this search:
source="WinEventLog:System" "system time has changed" | rex field=Message ".*to (?<StartTime>[^.]+).*from (?<EndTime>[^.]+)\." | eval StartUnix=strptime(StartTime, "%Y-%m-%dT%H:%M:%S") | eval EndUnix=strptime(EndTime, "%Y-%m-%dT%H:%M:%S") | table _time host StartTime EndTime StartUnix EndUnix
However, like Lukas, the strptime wasn't doing the conversion.
Copying and pasting the text from Splunk into Notepad++ then actually the Message line is:
Message=The system time has changed to ?2015?-?12?-?13T13:28:07.492000000Z from ?2015?-?12?-?13T13:18:04.893874600Z.
Notice the hidden control codes around the date fields? What on earth were Microsoft thinking? Anyway I have a solution using the rex command.
rex field=Message ".*to \D(?<StartYear>\d+)\D-\D(?<StartMonth>\d+)\D-\D(?<StartDay>\d+)T(?<StartTime>.*)Z from \D(?<EndYear>\d+)\D-\D(?<EndMonth>\d+)\D-\D(?<EndDay>\d+)T(?<EndTime>.*)Z"
The full search string I used is:
source="WinEventLog:System" "system time has changed" | rex field=Message ".*to \D(?<StartYear>\d+)\D-\D(?<StartMonth>\d+)\D-\D(?<StartDay>\d+)T(?<StartTime>.*)Z from \D(?<EndYear>\d+)\D-\D(?<EndMonth>\d+)\D-\D(?<EndDay>\d+)T(?<EndTime>.*)Z" | strcat StartYear "-" StartMonth "-" StartDay "T" StartTime StartTime | strcat EndYear "-" EndMonth "-" EndDay "T" EndTime EndTime | eval StartUnix=strptime(StartTime, "%Y-%m-%dT%H:%M:%S.%9N") | eval EndUnix=strptime(EndTime, "%Y-%m-%dT%H:%M:%S.%9N") | eval TotalTime=EndUnix - StartUnix | table _time host StartTime EndTime StartUnix EndUnix TotalTime
... View more