Splunk Search

Why is data extraction showing different time formats?

priya1926
Path Finder

In the query  _time is already formatted. But when i try to export the data in csv its showing different formats. 

Query:

index="win event" host IN (USMDCKPAP30074) Event=6006 OR Event="6005" Type=Information
| eval Uptime = if(Event=6005,strftime(_time, "%Y-%d-%m %H:%M:%S"),null())
| table host Uptime

Eg:

2022-31-01 10:00:42
2022-29-01 06:40:11
2022-27-01 12:55:56

After exporting :

8/1/2022 4:08
1/1/2022 4:03
2021-25-12 04:03:29
2021-18-12 04:02:54
2021-16-12 10:14:45
2021-16-12 10:08:21
11/12/2021 4:08
4/12/2021 4:11

 

Labels (1)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

For starters, check the resulting csv file with a simple text editor and see what data you have in there. I suppose you're opening it in excel and there it looks like you're showing. Excel is notorious for raping date fields.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...