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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...