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!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...