Splunk Search

how to display time rightly in csv file

fzfeng
New Member

hello

I export my search result to csv file

but when I open it the time just display like this

1.52E+09

index=maillog I timechart span=1d,count(eval(IP=×××)) as IP1 I outputcsv IP1

Tags (1)
0 Karma

TISKAR
Builder

@fzfeng, can you try | convert ctime(_time) please, that work for me:

index=_internal
| timechart span=1d count(eval(log_level=INFO)) as countInfo 
| convert ctime(_time)
| outputcsv  tst.csv
0 Karma

mayurr98
Super Champion

Can you try this :

This is more efficient

index=maillog IP=XXXX | bin _time span=1d | stats count as IP1 by _time
0 Karma

fzfeng
New Member

thank you I tried it

and i set the time range one month

the graph it displaied 3/27 3/29 3/31 4/2 4/4 .....

but the table displaied 3/37 3/28 3/29 3/31 4/1 4/2 ....

0 Karma

janispelss
Path Finder

If the table has all the days, then everything is correct. The graph has all data points, it's just that not all labels are shown.

0 Karma

fzfeng
New Member

OK thank you very much

0 Karma

ssadanala1
Contributor

Are you seeing the issue when you are running |inputcsv IP1 .?

My understanding is that you are seeing the display 1.52E+09 when you download and open in excel .
If that is the case please increase the width size of the cell which gives excel enough space to display the value .

Thanks

0 Karma
Get Updates on the Splunk Community!

Pro Tips for First-Time .conf Attendees: Advice from SplunkTrust

Heading to your first .Conf? You’re in for an unforgettable ride — learning, networking, swag collecting, ...

Raise Your Skills at the .conf25 Builder Bar: Your Splunk Developer Destination

Calling all Splunk developers, custom SPL builders, dashboarders, and Splunkbase app creators – the Builder ...

Hunt Smarter, Not Harder: Discover New SPL “Recipes” in Our Threat Hunting Webinar

Are you ready to take your threat hunting skills to the next level? As Splunk community members, you know the ...